-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Logically it would seem that we are trying to check if the count of available updates is higher than zero, but that's not what actually happens. Looking at line 90 of https://github.com/evermade/wordpress-version-dashboard-client/blob/master/version-dashboard-client.php#L90 , it seems like the issue is as follows:
We set core_needs_update with this:
core_needs_update' => isset($coreInformation->updates) && count($coreInformation->updates) > 0
However, count($coreInformation->updates) returns 1 because if there are no updates, the transient returns false, and count(false) returns 1. The return value of get_site_transient() is further documented at https://developer.wordpress.org/reference/functions/get_site_transient/.
So, in the end we end up comparing if 1 > 0, and thus we get the value true here.