[wp-trac] [WordPress Trac] #55121: classic widgets with no settings won't show up in 5.9

WordPress Trac noreply at wordpress.org
Thu Feb 10 22:41:41 UTC 2022


#55121: classic widgets with no settings won't show up in 5.9
----------------------------+----------------------
 Reporter:  joncampbell     |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Widgets         |     Version:  5.9
 Severity:  normal          |  Resolution:  invalid
 Keywords:  has-patch php8  |     Focuses:
----------------------------+----------------------

Comment (by peterwilsoncc):

 > So realistically there are less than 6000 sites affected and of those,
 most won't be running PHP > 7.4.

 This is incorrect. As I mentioned, it's not possible for searches on
 wpdirectory.net to include line breaks so it is likely there is a greater
 number of sites affected.

 > WordPress should not cater or facilitate unlimitedly to plugins doing it
 wrong. IMO with this now being a fatal error in PHP 8.0, there is now a
 good argument to change it back to isset().

 I fundamentally disagree with this comment:

 * I disagree with both the assertion and the phrasing the plugins were
 ''doing it wrong''. The use of `array_key_exists()` was specifically to
 cater for this circumstance. Suboptimal, maybe, but certainly not wrong
 (whatever that means).
 * WordPress's often stated goal is to maintain backward compatibility. As
 PHP becomes stricter about type this isn't always possible but where
 possible WP should do so. The compatibility break with switch to `isset()`
 in this code is a developer convenience rather than a necessity.

 > This error then, can only ever occur if a plugin/theme would overload
 the Widget::get_settings() method and doesn't have the same safeguards in
 place

 I agree this is something WP probably doesn't need to account for.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55121#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list