PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.1
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.1
6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 All 155 releases
← All changes | includes/abilities/class-mainwp-abilities-util.php +9 -3 6.1.3 → 6.2.1 View file →
@@ -803,12 +803,18 @@
803 803 $wp_upgrades = MainWP_DB::instance()->get_website_option( $site, 'wp_upgrades' );
804 804 $wp_upgrades = ! empty( $wp_upgrades ) ? json_decode( $wp_upgrades, true ) : array();
805 805 $wp_update_available = is_array( $wp_upgrades ) && ! empty( $wp_upgrades );
806 806
807 - // Get health score if available.
807 + // Get health score if available. The health_value column is a sortable
808 + // composite (score - critical * 100) that goes negative when critical
809 + // issues exist; recompute the real 0-100 score from the stored Site
810 + // Health issue counts like the REST and UI surfaces do.
808 811 $health_score = null;
809 - if ( isset( $site->health_value ) ) {
810 - $health_score = (int) $site->health_value;
812 + // json_format=true returns a guaranteed array (scalars coerced to array()).
813 + $health_status = MainWP_DB::instance()->get_website_option( $site, 'health_site_status', array(), true );
814 + if ( ! empty( $health_status ) ) {
815 + $hstatus = MainWP_Utility::get_site_health( $health_status );
816 + $health_score = (int) $hstatus['val'];
811 817 }
812 818
813 819 return array(
814 820 'plugin_updates' => $plugin_count,