WPIntell

Source evidence

php7.2 Deprecated: Function create_function() is deprecated

Disable User Gravatar · support · 2018-06-13T15:15:00+00:00

complaintsentiment
mediumseverity
0.93relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

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

1 / 21 rows with source links

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

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
No3x unresolved
I just migrated php to 7.2 and reviewing all installed plugins. I do have problems with your plugin: Deprecated: Function create_function() is deprecated in disable-user-gravatar/disable-user-gravatar.php on line 35 add_filter('user_profile_picture_description', create_function('$desc', 'return "";')); This should be really easy to fix by using an anonymous function or a utility function of WordPress: add_filter('user_profile_picture_description', '__return_empty_string' ); I have tested this by modifying the filter to always return “Hello World”. After this I verified the behaviour by looking under a profile picture and “Hello World” was printed. Then I applied my Patch to use '__return_empty_string' . After this there is no output there. 1. I’m not sure if __return_empty_string is appropriate because of the parameters. But I don’t get an error complaining about missing parameters of __return_empty_string . 2. According to the user_profile_picture_description hook there is a second parameter $profileuser since WordPress 4.7.0. This one is missing in your current implementation by the way. Target WordPress version: since this fix uses __return_empty_string which was introduced in 3.7.0 the target version might increase. If this is not acceptable just use a anonymous function. Please note: you use __return_true which was introduced in 3.0.0. But the plugin min version is 2.7.0. Please increase to at least 3.0.0. This topic was modified 7 years, 11 months ago by No3x . Reason: added code tags This topic was modified 7 years, 11 months ago by No3x . Reason: added one more code tag This topic was modified 7 years, 11 months ago by No3x . Reason: fixed grammar This topic was modified 7 years, 11 months ago by No3x . Hi, Thanks for your suggestion. __return_empty_string is exactly what I’ll be adding, I’ve got that patch locally and have been meaning to update but short on time. I hadn’t thought of the target version, but yes good point. I think frankly 4.0 could even be the minimum, that’s already quite old 🙂 Hopefully nobody uses such an old WordPress version. If you increase to 4.0 then you should also replace the deprecated (in version 3.3.0) get_user_by_email($id_or_email) by get_user_by('email', $id_or_email); . I’m looking forward to your new release. This reply was modified 7 years, 11 months ago by No3x . noted, thanks! +1 would love to see this as well 🙂 thanks for the plugin.

Comments

4 shown
Marcus (aka @msykes) 2018-06-14T16:41:00+00:00

Hi, Thanks for your suggestion. __return_empty_string is exactly what I’ll be adding, I’ve got that patch locally and have been meaning to update but short on time. I hadn’t thought of the target version, but yes good point. I think frankly 4.0 could even be the minimum, that’s already quite old 🙂

No3x 2018-06-15T06:07:00+00:00

Hopefully nobody uses such an old WordPress version. If you increase to 4.0 then you should also replace the deprecated (in version 3.3.0) get_user_by_email($id_or_email) by get_user_by('email', $id_or_email); . I’m looking forward to your new release. This reply was modified 7 years, 11 months ago by No3x .

Marcus (aka @msykes) 2018-06-15T11:15:00+00:00

noted, thanks!

websupporter 2018-11-19T10:57:00+00:00

+1 would love to see this as well 🙂 thanks for the plugin.