diff --git a/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-15.sql b/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-15.sql new file mode 100644 index 00000000000..60ea7190cc7 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-15.sql @@ -0,0 +1,3 @@ +INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) +SELECT 0, 'plg_healthcheck_siteinfo', 'plugin', 'siteinfo', 'healthcheck', 0, 0, 1, 0, 1, '', '{"context":"general"}', '', 0, 0 +WHERE NOT EXISTS (SELECT * FROM `#__extensions` g WHERE g.`element` = 'siteinfo' AND g.`folder` = 'healthcheck'); diff --git a/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-16.sql b/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-16.sql new file mode 100644 index 00000000000..aeb8a31c1e8 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-16.sql @@ -0,0 +1,3 @@ +INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) +SELECT 0, 'plg_healthcheck_ssl', 'plugin', 'ssl', 'healthcheck', 0, 0, 1, 0, 1, '', '{"context":"security"}', '', 0, 0 +WHERE NOT EXISTS (SELECT * FROM `#__extensions` g WHERE g.`element` = 'ssl' AND g.`folder` = 'healthcheck'); diff --git a/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-17.sql b/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-17.sql new file mode 100644 index 00000000000..f8dfdc68aba --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/6.2.0-2026-10-17.sql @@ -0,0 +1,3 @@ +INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) +SELECT 0, 'plg_healthcheck_securityheaders', 'plugin', 'securityheaders', 'healthcheck', 0, 0, 1, 0, 1, '', '{"context":"security"}', '', 0, 0 +WHERE NOT EXISTS (SELECT * FROM `#__extensions` g WHERE g.`element` = 'securityheaders' AND g.`folder` = 'healthcheck'); diff --git a/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-15.sql b/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-15.sql new file mode 100644 index 00000000000..64f9336589e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-15.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") +SELECT 0, 'plg_healthcheck_siteinfo', 'plugin', 'siteinfo', 'healthcheck', 0, 0, 1, 0, 1, '', '{"context":"general"}', '', 0, 0 +WHERE NOT EXISTS (SELECT * FROM "#__extensions" g WHERE g."element" = 'siteinfo' AND g."folder" = 'healthcheck'); diff --git a/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-16.sql b/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-16.sql new file mode 100644 index 00000000000..e12a599aaf0 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-16.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") +SELECT 0, 'plg_healthcheck_ssl', 'plugin', 'ssl', 'healthcheck', 0, 0, 1, 0, 1, '', '{"context":"security"}', '', 0, 0 +WHERE NOT EXISTS (SELECT * FROM "#__extensions" g WHERE g."element" = 'ssl' AND g."folder" = 'healthcheck'); diff --git a/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-17.sql b/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-17.sql new file mode 100644 index 00000000000..04949874410 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/6.2.0-2026-10-17.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") +SELECT 0, 'plg_healthcheck_securityheaders', 'plugin', 'securityheaders', 'healthcheck', 0, 0, 1, 0, 1, '', '{"context":"security"}', '', 0, 0 +WHERE NOT EXISTS (SELECT * FROM "#__extensions" g WHERE g."element" = 'securityheaders' AND g."folder" = 'healthcheck'); diff --git a/administrator/language/en-GB/mod_healthcheck.ini b/administrator/language/en-GB/mod_healthcheck.ini index 9e5400701ea..9fe021df9c9 100644 --- a/administrator/language/en-GB/mod_healthcheck.ini +++ b/administrator/language/en-GB/mod_healthcheck.ini @@ -53,6 +53,10 @@ MOD_HEALTHCHECK_NAV_LABEL="Health Check" MOD_HEALTHCHECK_NO_DATA="No health check data available" MOD_HEALTHCHECK_NO_MATCHING_RESULTS="All good! Nothing to report here." MOD_HEALTHCHECK_REFRESH="Refresh" +MOD_HEALTHCHECK_SECTION_COUNT_CRITICAL="%d Needs Attention" +MOD_HEALTHCHECK_SECTION_COUNT_HEALTHY="%d Healthy" +MOD_HEALTHCHECK_SECTION_COUNT_WARNING="%d Needs Review" +MOD_HEALTHCHECK_SECTION_OTHER="Other checks" MOD_HEALTHCHECK_STATUS_ERROR="Error" MOD_HEALTHCHECK_STATUS_INFO="Information" MOD_HEALTHCHECK_STATUS_OK="OK" diff --git a/administrator/language/en-GB/plg_healthcheck_securityheaders.ini b/administrator/language/en-GB/plg_healthcheck_securityheaders.ini new file mode 100644 index 00000000000..f3e8ca39566 --- /dev/null +++ b/administrator/language/en-GB/plg_healthcheck_securityheaders.ini @@ -0,0 +1,37 @@ +; Joomla! Project +; (C) 2026 Open Source Matters, Inc. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_HEALTHCHECK_SECURITYHEADERS="Health Check - Security Headers" +PLG_HEALTHCHECK_SECURITYHEADERS_CHECKED="Last checked: %s. Select to check again." +PLG_HEALTHCHECK_SECURITYHEADERS_CHECK_NOW="Check the security headers again" +PLG_HEALTHCHECK_SECURITYHEADERS_COLUMN_FIX="How to Fix" +PLG_HEALTHCHECK_SECURITYHEADERS_COLUMN_HEADER="Header" +PLG_HEALTHCHECK_SECURITYHEADERS_COLUMN_POINTS="Points" +PLG_HEALTHCHECK_SECURITYHEADERS_COLUMN_VALUE="Value Sent" +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_COOP="Send Cross-Origin-Opener-Policy, for example same-origin. The System - HTTP Headers plugin can set it." +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_CSP="Send a Content-Security-Policy. The System - HTTP Headers plugin can set one; test it in report-only mode first." +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_FRAME="Send X-Frame-Options SAMEORIGIN or DENY, or a CSP frame-ancestors directive. The System - HTTP Headers plugin can set both." +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_HSTS="Send Strict-Transport-Security with a max-age of at least 180 days (15552000). Browsers remember it, so start with a short max-age and raise it once every page works over HTTPS. The System - HTTP Headers plugin can set it." +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_HSTS_HTTP="The homepage is not served over HTTPS, so browsers ignore HSTS. Install a certificate, serve the site over HTTPS, then turn on Force HTTPS in Global Configuration (Server)." +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_LEAK="Hide version numbers in the Server and X-Powered-By headers (for example ServerTokens Prod in Apache, server_tokens off in nginx, expose_php = Off in PHP)." +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_NOSNIFF="Joomla's htaccess.txt (Apache) and web.config.txt (IIS) already send X-Content-Type-Options: nosniff; rename the file to .htaccess or web.config. On nginx, add: add_header X-Content-Type-Options nosniff always;" +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_PERMISSIONS="Send a Permissions-Policy that turns off browser features the site does not use, for example camera=(), microphone=(), geolocation=()." +PLG_HEALTHCHECK_SECURITYHEADERS_FIX_REFERRER="Send Referrer-Policy strict-origin-when-cross-origin (or stricter). The System - HTTP Headers plugin can set it." +PLG_HEALTHCHECK_SECURITYHEADERS_GAUGE_LABEL="Security Headers" +PLG_HEALTHCHECK_SECURITYHEADERS_GAUGE_SUBLABEL="%d of 100 points" +PLG_HEALTHCHECK_SECURITYHEADERS_GROUP_DESC="Health Check modules with the same group show this plugin's results." +PLG_HEALTHCHECK_SECURITYHEADERS_GROUP_LABEL="Health Check Group" +PLG_HEALTHCHECK_SECURITYHEADERS_OPEN_CONFIG="Open Global Configuration" +PLG_HEALTHCHECK_SECURITYHEADERS_OPEN_HTTPHEADERS="Open HTTP Headers settings" +PLG_HEALTHCHECK_SECURITYHEADERS_REASON_NO_CURL="The PHP cURL extension is not available." +PLG_HEALTHCHECK_SECURITYHEADERS_REASON_NO_HEADERS="The site answered without any headers." +PLG_HEALTHCHECK_SECURITYHEADERS_REASON_REDIRECTS="The homepage redirected more than three times." +PLG_HEALTHCHECK_SECURITYHEADERS_SECTION="Security Headers" +PLG_HEALTHCHECK_SECURITYHEADERS_TABLE_CAPTION="Security headers sent by %1$s (HTTP %2$s)" +PLG_HEALTHCHECK_SECURITYHEADERS_TIMEOUT_DESC="How long to wait, in seconds, for the site's homepage." +PLG_HEALTHCHECK_SECURITYHEADERS_TIMEOUT_LABEL="Timeout (seconds)" +PLG_HEALTHCHECK_SECURITYHEADERS_TITLE_REASON="Reason: %s" +PLG_HEALTHCHECK_SECURITYHEADERS_UNCHECKED="Could not check the headers" +PLG_HEALTHCHECK_SECURITYHEADERS_XML_DESCRIPTION="Scores the HTTP security headers the site's homepage sends, from 0 to 100, and explains how to improve each one." diff --git a/administrator/language/en-GB/plg_healthcheck_securityheaders.sys.ini b/administrator/language/en-GB/plg_healthcheck_securityheaders.sys.ini new file mode 100644 index 00000000000..c1b1850a9cd --- /dev/null +++ b/administrator/language/en-GB/plg_healthcheck_securityheaders.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; (C) 2026 Open Source Matters, Inc. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_HEALTHCHECK_SECURITYHEADERS="Health Check - Security Headers" +PLG_HEALTHCHECK_SECURITYHEADERS_XML_DESCRIPTION="Scores the HTTP security headers the site's homepage sends, from 0 to 100, and explains how to improve each one." diff --git a/administrator/language/en-GB/plg_healthcheck_siteinfo.ini b/administrator/language/en-GB/plg_healthcheck_siteinfo.ini new file mode 100644 index 00000000000..f745f689dec --- /dev/null +++ b/administrator/language/en-GB/plg_healthcheck_siteinfo.ini @@ -0,0 +1,49 @@ +; Joomla! Project +; (C) 2026 Open Source Matters, Inc. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_HEALTHCHECK_SITEINFO="Health Check - Site Information" +PLG_HEALTHCHECK_SITEINFO_COLUMN_COMPONENT="Component" +PLG_HEALTHCHECK_SITEINFO_COLUMN_CURRENT="Current Value" +PLG_HEALTHCHECK_SITEINFO_COLUMN_ENDS="Support Ends" +PLG_HEALTHCHECK_SITEINFO_COLUMN_RECOMMENDED="Recommended" +PLG_HEALTHCHECK_SITEINFO_COLUMN_SETTING="Setting" +PLG_HEALTHCHECK_SITEINFO_COLUMN_STATUS="Support Status" +PLG_HEALTHCHECK_SITEINFO_COLUMN_VERSION="Version" +PLG_HEALTHCHECK_SITEINFO_COMPONENT_DATABASE="Database" +PLG_HEALTHCHECK_SITEINFO_COMPONENT_OS="Operating System" +PLG_HEALTHCHECK_SITEINFO_COMPONENT_WEBSERVER="Web Server" +PLG_HEALTHCHECK_SITEINFO_GROUP_DESC="Health Check modules with the same group show this plugin's results." +PLG_HEALTHCHECK_SITEINFO_GROUP_LABEL="Health Check Group" +PLG_HEALTHCHECK_SITEINFO_ICON_REFRESH="Refresh Requirements" +PLG_HEALTHCHECK_SITEINFO_ICON_TEXT="Software Support" +PLG_HEALTHCHECK_SITEINFO_PRODUCT_JOOMLA="Joomla" +PLG_HEALTHCHECK_SITEINFO_PRODUCT_MARIADB="MariaDB" +PLG_HEALTHCHECK_SITEINFO_PRODUCT_MYSQL="MySQL" +PLG_HEALTHCHECK_SITEINFO_PRODUCT_PHP="PHP" +PLG_HEALTHCHECK_SITEINFO_PRODUCT_POSTGRESQL="PostgreSQL" +PLG_HEALTHCHECK_SITEINFO_RECOMMENDED_DISPLAY_ERRORS="Off on live sites" +PLG_HEALTHCHECK_SITEINFO_RECOMMENDED_EXECUTION="30 or more (0 is unlimited)" +PLG_HEALTHCHECK_SITEINFO_RECOMMENDED_MEMORY="%s or more" +PLG_HEALTHCHECK_SITEINFO_RECOMMENDED_OPCACHE="Enabled" +PLG_HEALTHCHECK_SITEINFO_RECOMMENDED_POST="At least upload_max_filesize (%s)" +PLG_HEALTHCHECK_SITEINFO_REFRESH_DONE="Joomla requirements refreshed from manual.joomla.org." +PLG_HEALTHCHECK_SITEINFO_REFRESH_FAILED="Could not refresh Joomla requirements from manual.joomla.org. The previous values are still used. %s" +PLG_HEALTHCHECK_SITEINFO_REFRESH_RECENT="Joomla requirements were refreshed less than an hour ago, so they were not fetched again." +PLG_HEALTHCHECK_SITEINFO_REQUIREMENT_BELOW_MINIMUM="Below Joomla's minimum version %s" +PLG_HEALTHCHECK_SITEINFO_REQUIREMENT_BELOW_RECOMMENDED="Joomla recommends %s" +PLG_HEALTHCHECK_SITEINFO_REQUIREMENT_BELOW_SUPPORTED="Below Joomla's supported version %s" +PLG_HEALTHCHECK_SITEINFO_SECTION="Site Information" +PLG_HEALTHCHECK_SITEINFO_STATUS_EOL_OLD="End of life" +PLG_HEALTHCHECK_SITEINFO_STATUS_EOL_PAST="End of life since %s" +PLG_HEALTHCHECK_SITEINFO_STATUS_EOL_SOON="End of life on %s" +PLG_HEALTHCHECK_SITEINFO_STATUS_NEWER="Newer than known support data" +PLG_HEALTHCHECK_SITEINFO_STATUS_NO_DATA="No support data" +PLG_HEALTHCHECK_SITEINFO_STATUS_SECURITY_ONLY="Security fixes only until %s" +PLG_HEALTHCHECK_SITEINFO_STATUS_SUPPORTED="Supported until %s" +PLG_HEALTHCHECK_SITEINFO_STATUS_UNKNOWN="Unknown" +PLG_HEALTHCHECK_SITEINFO_TABLE_SETTINGS="PHP Settings" +PLG_HEALTHCHECK_SITEINFO_TABLE_VERSIONS_BUILTIN="Software Versions. Joomla requirements: shipped with Joomla." +PLG_HEALTHCHECK_SITEINFO_TABLE_VERSIONS_MANUAL="Software Versions. Joomla requirements: manual.joomla.org, retrieved %s." +PLG_HEALTHCHECK_SITEINFO_XML_DESCRIPTION="Shows the versions of PHP, the database, Joomla, the web server and the operating system, whether each is still supported, and checks PHP settings against Joomla's recommendations." diff --git a/administrator/language/en-GB/plg_healthcheck_siteinfo.sys.ini b/administrator/language/en-GB/plg_healthcheck_siteinfo.sys.ini new file mode 100644 index 00000000000..6938a08f504 --- /dev/null +++ b/administrator/language/en-GB/plg_healthcheck_siteinfo.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; (C) 2026 Open Source Matters, Inc. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_HEALTHCHECK_SITEINFO="Health Check - Site Information" +PLG_HEALTHCHECK_SITEINFO_XML_DESCRIPTION="Shows the versions of PHP, the database, Joomla, the web server and the operating system, whether each is still supported, and checks PHP settings against Joomla's recommendations." diff --git a/administrator/language/en-GB/plg_healthcheck_ssl.ini b/administrator/language/en-GB/plg_healthcheck_ssl.ini new file mode 100644 index 00000000000..3d8412ee637 --- /dev/null +++ b/administrator/language/en-GB/plg_healthcheck_ssl.ini @@ -0,0 +1,45 @@ +; Joomla! Project +; (C) 2026 Open Source Matters, Inc. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_HEALTHCHECK_SSL="Health Check - SSL Certificate" +; Your own advice shown under the message for each status. Set these with System > Language Overrides (Administrator). +PLG_HEALTHCHECK_SSL_CUSTOM_ERROR="" +PLG_HEALTHCHECK_SSL_CUSTOM_NONE="" +PLG_HEALTHCHECK_SSL_CUSTOM_SUCCESS="" +PLG_HEALTHCHECK_SSL_CUSTOM_WARNING="" +PLG_HEALTHCHECK_SSL_ERROR_DAYS_DESC="Show an error when the certificate expires in this many days or fewer." +PLG_HEALTHCHECK_SSL_ERROR_DAYS_LABEL="Error Threshold (days)" +PLG_HEALTHCHECK_SSL_GROUP_DESC="Health Check modules with the same group show this plugin's results." +PLG_HEALTHCHECK_SSL_GROUP_LABEL="Health Check Group" +PLG_HEALTHCHECK_SSL_ICON_NAME="SSL Certificate" +PLG_HEALTHCHECK_SSL_REASON_HANDSHAKE="The TLS handshake failed without an error message." +PLG_HEALTHCHECK_SSL_REASON_NO_HOST="The site URL has no host name." +PLG_HEALTHCHECK_SSL_REASON_NO_OPENSSL="The PHP OpenSSL extension is not available." +PLG_HEALTHCHECK_SSL_REASON_NO_STREAMS="PHP stream socket functions are disabled on this server." +PLG_HEALTHCHECK_SSL_REASON_PROBE_ERROR="The certificate check failed unexpectedly." +PLG_HEALTHCHECK_SSL_REASON_UNREADABLE="The certificate could not be read." +PLG_HEALTHCHECK_SSL_SECTION="SSL Certificate" +PLG_HEALTHCHECK_SSL_STATUS_EXPIRED="Expired on %s" +PLG_HEALTHCHECK_SSL_STATUS_EXPIRES_N="Expires in %1$s days (%2$s)" +PLG_HEALTHCHECK_SSL_STATUS_EXPIRES_N_0="Expires today (%2$s)" +PLG_HEALTHCHECK_SSL_STATUS_EXPIRES_N_1="Expires in 1 day (%2$s)" +PLG_HEALTHCHECK_SSL_STATUS_NOT_YET_VALID="Not valid until %s" +PLG_HEALTHCHECK_SSL_STATUS_NO_HTTPS="Site is not served over HTTPS" +PLG_HEALTHCHECK_SSL_STATUS_RENEW_SOON_N="Expires in %1$s days (%2$s). Renew soon." +PLG_HEALTHCHECK_SSL_STATUS_RENEW_SOON_N_1="Expires in 1 day (%2$s). Renew soon." +PLG_HEALTHCHECK_SSL_STATUS_UNCHECKED="Could not check the certificate" +PLG_HEALTHCHECK_SSL_STATUS_UNTRUSTED="Certificate not trusted (expires %s)" +PLG_HEALTHCHECK_SSL_STATUS_VALID_N="Expires in %1$s days (%2$s)" +PLG_HEALTHCHECK_SSL_STATUS_VALID_N_1="Expires in 1 day (%2$s)" +PLG_HEALTHCHECK_SSL_TIMEOUT_DESC="How long to wait, in seconds, when connecting to the site to read its certificate." +PLG_HEALTHCHECK_SSL_TIMEOUT_LABEL="Timeout (seconds)" +PLG_HEALTHCHECK_SSL_TITLE_CHECKED="Last checked: %s. Select to check again." +PLG_HEALTHCHECK_SSL_TITLE_ISSUER="Issuer: %s." +PLG_HEALTHCHECK_SSL_TITLE_NO_HTTPS="If a proxy or CDN provides HTTPS for this site, enable Behind Load Balancer in Global Configuration. Otherwise install a certificate, then enable Force HTTPS." +PLG_HEALTHCHECK_SSL_TITLE_REASON="Reason: %s." +PLG_HEALTHCHECK_SSL_TITLE_SUBJECT="Issued for: %s." +PLG_HEALTHCHECK_SSL_WARNING_DAYS_DESC="Show a warning when the certificate expires in this many days or fewer." +PLG_HEALTHCHECK_SSL_WARNING_DAYS_LABEL="Warning Threshold (days)" +PLG_HEALTHCHECK_SSL_XML_DESCRIPTION="Shows how many days are left before the site's SSL/TLS certificate expires, and whether it is trusted." diff --git a/administrator/language/en-GB/plg_healthcheck_ssl.sys.ini b/administrator/language/en-GB/plg_healthcheck_ssl.sys.ini new file mode 100644 index 00000000000..ece44fa925c --- /dev/null +++ b/administrator/language/en-GB/plg_healthcheck_ssl.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; (C) 2026 Open Source Matters, Inc. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_HEALTHCHECK_SSL="Health Check - SSL Certificate" +PLG_HEALTHCHECK_SSL_XML_DESCRIPTION="Shows how many days are left before the site's SSL/TLS certificate expires, and whether it is trusted." diff --git a/administrator/language/en-GB/plg_healthcheck_usermaintenance.ini b/administrator/language/en-GB/plg_healthcheck_usermaintenance.ini index 4a8fcd65702..f0055403416 100644 --- a/administrator/language/en-GB/plg_healthcheck_usermaintenance.ini +++ b/administrator/language/en-GB/plg_healthcheck_usermaintenance.ini @@ -36,6 +36,7 @@ PLG_HEALTHCHECK_USERMAINTENANCE_NEVERLOGGEDIN_FIELD_LABEL="Never Logged In Users PLG_HEALTHCHECK_USERMAINTENANCE_ORPHAN_FIELD_LABEL="Users Without User Group" PLG_HEALTHCHECK_USERMAINTENANCE_PRIVILEGED_FIELD_DESC="Users who are granted administrator or super user privileges." PLG_HEALTHCHECK_USERMAINTENANCE_PRIVILEGED_FIELD_LABEL="Users With Higher Privileges" +PLG_HEALTHCHECK_USERMAINTENANCE_SECTION="User Maintenance" PLG_HEALTHCHECK_USERMAINTENANCE_UNACTIVATED_FIELD_DESC="Users who created an account, but did not finish the activation process." PLG_HEALTHCHECK_USERMAINTENANCE_UNACTIVATED_FIELD_LABEL="Unactivated Users" PLG_HEALTHCHECK_USERMAINTENANCE_XML_DESCRIPTION="This HealthCheck plugin gives you an oversight about the number of unhealthy user accounts." diff --git a/administrator/modules/mod_healthcheck/src/Helper/HealthCheckHelper.php b/administrator/modules/mod_healthcheck/src/Helper/HealthCheckHelper.php index 227f0f8e449..9556a3d737b 100644 --- a/administrator/modules/mod_healthcheck/src/Helper/HealthCheckHelper.php +++ b/administrator/modules/mod_healthcheck/src/Helper/HealthCheckHelper.php @@ -190,6 +190,7 @@ public function getGauges(Registry $params, ?CMSApplication $application = null) 'access' => true, 'class' => null, 'group' => 'general', + 'section' => null, ]; $requiredFields = [ @@ -233,6 +234,7 @@ public function getButtons(Registry $params, ?CMSApplication $application = null 'access' => true, 'status' => null, 'group' => 'general', + 'section' => null, ]; $requiredFields = [ @@ -266,10 +268,11 @@ public function getButtons(Registry $params, ?CMSApplication $application = null public function getLists(Registry $params, ?CMSApplication $application = null) { $defaults = [ - 'items' => null, - 'access' => true, - 'class' => null, - 'group' => 'general', + 'items' => null, + 'access' => true, + 'class' => null, + 'group' => 'general', + 'section' => null, ]; $requiredFields = [ @@ -308,6 +311,7 @@ public function getTables(Registry $params, ?CMSApplication $application = null) 'access' => true, 'class' => null, 'group' => 'general', + 'section' => null, ]; $requiredFields = [ @@ -390,4 +394,131 @@ public function getFooter(Registry $params, ?CMSApplication $application = null) $application ); } + + /** + * Group items of every type into panels by their optional 'section' title. + * Panels keep the order in which their title first appears (gauges, then buttons, lists, tables); + * items without a usable section go into one panel titled $otherLabel, always last. + * + * @param array $gauges Gauge items + * @param array $buttons Icon items + * @param array $lists List items + * @param array $tables Table items + * @param string $otherLabel Title of the panel for items without a section + * + * @return array List of ['title' => string, 'gauges' => array, 'buttons' => array, 'lists' => array, 'tables' => array] + * + * @since __DEPLOY_VERSION__ + */ + public static function groupBySection(array $gauges, array $buttons, array $lists, array $tables, string $otherLabel): array + { + $empty = ['gauges' => [], 'buttons' => [], 'lists' => [], 'tables' => []]; + $sections = []; + $other = ['title' => $otherLabel] + $empty; + + foreach (['gauges' => $gauges, 'buttons' => $buttons, 'lists' => $lists, 'tables' => $tables] as $type => $items) { + foreach ($items as $item) { + $title = \is_array($item) && \is_string($item['section'] ?? null) ? trim($item['section']) : ''; + + if ($title === '') { + $other[$type][] = $item; + + continue; + } + + $sections[$title] ??= ['title' => $title] + $empty; + $sections[$title][$type][] = $item; + } + } + + $result = array_values($sections); + + if ($other['gauges'] || $other['buttons'] || $other['lists'] || $other['tables']) { + $result[] = $other; + } + + return $result; + } + + /** + * Summarise a panel: how many items are critical, warning and healthy, and the worst of them. + * Statuses are mapped exactly as the layouts map them; a gauge without a status takes it from its score. + * + * @param array $section One panel from groupBySection() + * + * @return array ['worst' => string, 'counts' => ['critical' => int, 'warning' => int, 'healthy' => int]] + * + * @since __DEPLOY_VERSION__ + */ + public static function summarise(array $section): array + { + $counts = ['critical' => 0, 'warning' => 0, 'healthy' => 0]; + + foreach (['gauges', 'buttons', 'lists', 'tables'] as $type) { + foreach ($section[$type] ?? [] as $item) { + $counts[$type === 'gauges' ? self::gaugeStatus($item) : self::itemStatus($item['status'] ?? null)]++; + } + } + + return [ + 'worst' => $counts['critical'] ? 'critical' : ($counts['warning'] ? 'warning' : 'healthy'), + 'counts' => $counts, + ]; + } + + /** + * Accordion id that is unique for every call in this request, so a module rendered twice never repeats an id. + * + * @param int $moduleId The module id + * + * @return string + * + * @since __DEPLOY_VERSION__ + */ + public static function accordionId(int $moduleId): string + { + static $counter = 0; + + return 'healthcheck-sections-' . $moduleId . '-' . (++$counter); + } + + /** + * Map an item status the way the icon, list and table layouts do. + * + * @param mixed $status The item's status + * + * @return string critical, warning or healthy + * + * @since __DEPLOY_VERSION__ + */ + private static function itemStatus(mixed $status): string + { + return match ($status) { + 'error' => 'critical', + 'warning' => 'warning', + default => 'healthy', + }; + } + + /** + * Map a gauge status the way the gauge layout does: an explicit status wins, otherwise the score decides. + * + * @param array $gauge Gauge item + * + * @return string critical, warning or healthy + * + * @since __DEPLOY_VERSION__ + */ + private static function gaugeStatus(array $gauge): string + { + if (isset($gauge['status'])) { + return self::itemStatus($gauge['status']); + } + + $score = (float) ($gauge['score'] ?? 0); + $warning = (float) ($gauge['score_threshold_warning'] ?? 50); + $success = (float) ($gauge['score_threshold_success'] ?? 90); + + return $score < $warning ? 'critical' : ($score < $success ? 'warning' : 'healthy'); + } } diff --git a/administrator/modules/mod_healthcheck/tmpl/default.php b/administrator/modules/mod_healthcheck/tmpl/default.php index 0501097e83c..64ee7791cb9 100644 --- a/administrator/modules/mod_healthcheck/tmpl/default.php +++ b/administrator/modules/mod_healthcheck/tmpl/default.php @@ -13,6 +13,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; +use Joomla\Module\Healthcheck\Administrator\Helper\HealthCheckHelper; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $app->getDocument()->getWebAssetManager(); @@ -32,14 +33,48 @@ // Label for the close button of the code modal opened by the async script. Text::script('JCLOSE'); -$gauges_html = HTMLHelper::_('healthchecks.gauges', $gauges); -$buttons_html = HTMLHelper::_('healthchecks.buttons', $buttons); -$lists_html = HTMLHelper::_('healthchecks.lists', $lists); -$tables_html = HTMLHelper::_('healthchecks.tables', $tables); $leading_html = HTMLHelper::_('healthchecks.leadings', $leading); $footer_html = HTMLHelper::_('healthchecks.footers', $footer); -$has_data = !empty($gauges_html) || !empty($buttons_html) || !empty($lists_html) || !empty($tables_html); +// One panel per plugin section. Each item is rendered once; items the user cannot access render as '' +// and are left out of both the body and the header summary. Panels with nothing left are skipped. +$panels = []; +$types = ['gauges' => ['gauge', 'nav'], 'buttons' => ['button', 'nav'], 'lists' => ['list', 'mt-3'], 'tables' => ['table', 'div']]; + +foreach (HealthCheckHelper::groupBySection($gauges, $buttons, $lists, $tables, Text::_('MOD_HEALTHCHECK_SECTION_OTHER')) as $section) { + $kept = ['title' => $section['title'], 'gauges' => [], 'buttons' => [], 'lists' => [], 'tables' => []]; + $body = ''; + + foreach ($types as $type => [$helper, $wrapper]) { + $html = ''; + + foreach ($section[$type] as $item) { + $itemHtml = HTMLHelper::_('healthchecks.' . $helper, $item); + + if ($itemHtml !== '') { + $kept[$type][] = $item; + $html .= $itemHtml; + } + } + + if ($html === '') { + continue; + } + + $body .= match ($wrapper) { + 'nav' => '', + 'div' => '
' . $html . '
', + default => '
    ' . $html . '
', + }; + } + + if ($body !== '') { + $panels[] = ['section' => $kept, 'body' => $body]; + } +} + +$has_data = $panels !== []; +$accordionId = HealthCheckHelper::accordionId((int) $module->id); ?> @@ -71,33 +106,19 @@