diff --git a/Puc/v4p4/UpdateChecker.php b/Puc/v4p4/UpdateChecker.php index 7ead6fe..76eaf44 100644 --- a/Puc/v4p4/UpdateChecker.php +++ b/Puc/v4p4/UpdateChecker.php @@ -301,6 +301,14 @@ if ( !class_exists('Puc_v4p4_UpdateChecker', false) ): //Let plugins/themes modify the update. $update = apply_filters($this->getUniqueName('request_update_result'), $update, $httpResult); + // "Tested up to" field in the plugin metadata is supposed to be in form of "major.minor", + // while WordPress core's list_plugin_updates() expects the $update->tested field to be + // the exact version, e.g. "major.minor.patch", to say it's compatible. In other case it would + // show "Compatibility: Unknown". That kinda mimics how wordpress.org API handles the "tested" field. + if (isset($update->tested) && preg_match('/^\d+\.\d+$/', $update->tested)) { + $update->tested .= ".999"; + } + if ( isset($update, $update->translations) ) { //Keep only those translation updates that apply to this site. $update->translations = $this->filterApplicableTranslations($update->translations);