@@ -864,15 +864,22 @@ protected function get_item_list() {
864
864
$ items [ $ file ]['requires_php ' ] = isset ( $ plugin_update_info ->requires_php ) ? $ plugin_update_info ->requires_php : null ;
865
865
}
866
866
867
- // If there is a plugin in no_update with a newer version than the local copy, it is because the plugins update api
868
- // has already filtered it because the local WordPress version is too low
867
+ // If there is a plugin in no_update with a newer version than the local copy, it is either because:
868
+ // A: the plugins update API has already filtered it because the local WordPress version is too low
869
+ // B: It is possibly a paid plugin that has an update which the user does not qualify for
869
870
if ( null !== $ plugin_update_info && version_compare ( $ details ['Version ' ], $ plugin_update_info ->new_version , '< ' ) ) {
870
871
$ items [ $ file ]['update ' ] = 'unavailable ' ;
871
872
$ items [ $ file ]['update_version ' ] = $ plugin_update_info ->new_version ;
872
873
$ items [ $ file ]['requires ' ] = isset ( $ plugin_update_info ->requires ) ? $ plugin_update_info ->requires : null ;
873
874
$ items [ $ file ]['requires_php ' ] = isset ( $ plugin_update_info ->requires_php ) ? $ plugin_update_info ->requires_php : null ;
874
875
875
- $ reason = "This update requires WordPress version $ plugin_update_info ->requires , but the version installed is $ wp_version. " ;
876
+ if ( isset ( $ plugin_update_info ->requires ) && version_compare ( $ wp_version , $ requires , '>= ' ) ) {
877
+ $ reason = "This update requires WordPress version $ plugin_update_info ->requires , but the version installed is $ wp_version. " ;
878
+ } elseif ( ! isset ( $ update_info ['package ' ] ) ) {
879
+ $ reason = 'Update file not provided. Contact author for more details ' ;
880
+ } else {
881
+ $ reason = 'Update not available ' ;
882
+ }
876
883
877
884
$ items [ $ file ]['update_unavailable_reason ' ] = $ reason ;
878
885
0 commit comments