Closed pondermatic closed 2 years ago
Surprisingly, WP_List_Util::pluck() does not check if the property exists, which causes a PHP warning to be logged.
Yeah I actually found this rather annoying :/
This code has not changed in a long time, so I can't figure out why I haven't noticed this before.
Maybe what changed is the rest api response, maybe it included the plugin
property before?
I'm not confident with that part of code, but I guess that we can just include the plugin
field in the response's object?|
Surely, this issue only exists on my system? Can anyone else reproduce this?
I remember I saw that warning a bunch of times and said to myself "gonna check what's this all about", I also remember that I rapidly checked it also happened disabling LifterLMS so I wrongly decided we were not involved. Of course we were, since we put that data in the transient :D. Nice catch.
Reproduction Steps
DELETE FROM wp_options WHERE option_name = '_site_transient_update_plugins';
WP_Plugin_Install_List_Table::prepare_items()
gets$installed_plugins
fromWP_Plugin_Install_List_Table::get_installed_plugins()
and then tries to pluck theplugin
property from$installed_plugins
. Surprisingly,WP_List_Util::pluck()
does not check if the property exists, which causes a PHP warning to be logged.WP_Plugin_Install_List_Table::get_installed_plugins()
gets plugin info from theupdate_plugins
transient.When the
update_plugins
transient is set,LLMS_Helper_Upgrader::pre_set_site_transient_update_things()
gets LifterLMS add on information from https://lifterlms.com/wp-json/llms/v3/products, then callsLLMS_Helper_Upgrader::set_plugins_api()
to get a plugin item object. This object does not have aplugin
property and is eventually saved to theupdate_plugins
site transient.This code has not changed in a long time, so I can't figure out why I haven't noticed this before. Surely, this issue only exists on my system? Can anyone else reproduce this?
Expected Behavior
Actual Behavior
Error Messages / Logs
System and Environment Information
WordPress 5.9.1-src LifterLMS 6.2.0 PHP 8.0 Windows 10
This issue has been recreated: