From b33f6c1c1a859253db1cd187562a10c3eedaafef Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Tue, 14 Sep 2021 17:14:51 +0200 Subject: [PATCH] Remove useless results cleaning --- classes/output/renderer.php | 57 ------------------------------------- 1 file changed, 57 deletions(-) diff --git a/classes/output/renderer.php b/classes/output/renderer.php index d608915..fc13a8a 100644 --- a/classes/output/renderer.php +++ b/classes/output/renderer.php @@ -96,25 +96,6 @@ public function render_tab_viewtable() { ORDER BY count(pl.*) DESC, pl.frankenstyle ASC'; $result_plugins = $DB->get_records_sql($sql_plugins); - // Clean results from Moodle instances which have reported all plugins as installed which is simply not realistic - // but rather some strange webserver configuration. - $countfoundplugins = count($result_plugins); - foreach ($result_sitesplugins as $s) { - if ($s->count == $countfoundplugins) { - // Remove site entry from list of sites. - unset ($result_sitesplugins[$s->id]); - // Decrease plugin count in list of plugins. - foreach ($result_plugins as $p) { - $currentcount = $result_plugins[$p->id]->count; - if ($currentcount - 1 > 0) { - $result_plugins[$p->id]->count = $currentcount - 1; - } else { - unset($result_plugins[$p->id]); - } - } - } - } - // Build table heading. $output .= \html_writer::tag('h3', get_string('table_pluginusedlabel', 'local_sitestats')); @@ -315,25 +296,6 @@ public function render_tab_viewchart() { ORDER BY count(pl.*) DESC, pl.frankenstyle ASC'; $result_plugins = $DB->get_records_sql($sql_plugins); - // Clean results from Moodle instances which have reported all plugins as installed which is simply not realistic - // but rather some strange webserver configuration. - $countfoundplugins = count($result_plugins); - foreach ($result_sites as $s) { - if ($s->count == $countfoundplugins) { - // Remove site entry from list of sites. - unset ($result_sites[$s->id]); - // Decrease plugin count in list of plugins. - foreach ($result_plugins as $p) { - $currentcount = $result_plugins[$p->id]->count; - if ($currentcount - 1 > 0) { - $result_plugins[$p->id]->count = $currentcount - 1; - } else { - unset($result_plugins[$p->id]); - } - } - } - } - // Pick the most used plugins. $i = 0; $mostusedpluginsabsolutedata = array(); @@ -502,25 +464,6 @@ public function render_tab_viewmetrics() { ORDER BY count(pl.*) DESC, pl.frankenstyle ASC'; $result_plugins = $DB->get_records_sql($sql_plugins); - // Clean results from Moodle instances which have reported all plugins as installed which is simply not realistic - // but rather some strange webserver configuration. - $countfoundplugins = count($result_plugins); - foreach ($result_sites as $s) { - if ($s->count == $countfoundplugins) { - // Remove site entry from list of sites. - unset ($result_sites[$s->id]); - // Decrease plugin count in list of plugins. - foreach ($result_plugins as $p) { - $currentcount = $result_plugins[$p->id]->count; - if ($currentcount - 1 > 0) { - $result_plugins[$p->id]->count = $currentcount - 1; - } else { - unset($result_plugins[$p->id]); - } - } - } - } - // Get most plugins on a site. $mostpluginsonasite = 0; foreach ($result_sites as $site) {