From d486eb9d28c456d0c4a67eeb51a2c5b5000b9300 Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Fri, 6 Dec 2024 13:45:49 +0100 Subject: [PATCH 1/3] fix: hide wp error page --- .gitignore | 1 + wp-content/php-error.php | 137 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 wp-content/php-error.php diff --git a/.gitignore b/.gitignore index e3f0c8b..4a86b27 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /wp-content/* !/wp-content/plugins/cookies-and-content-security-policy-vars.php !/wp-content/object-cache.php +!/wp-content/php-error.php !/wp-content/sunrise.php /wp-content/mu-plugins/* !/wp-content/mu-plugins diff --git a/wp-content/php-error.php b/wp-content/php-error.php new file mode 100644 index 0000000..2a71d7d --- /dev/null +++ b/wp-content/php-error.php @@ -0,0 +1,137 @@ + + + + + + + <?php _e('Critical Error', 'default'); ?> + + + +
+

+

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ + \ No newline at end of file From 3167ad7ac45fdb0ba4c816bc7604956f3a40bac7 Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Mon, 9 Dec 2024 12:45:11 +0100 Subject: [PATCH 2/3] fix: adds a swedish version of message --- wp-content/php-error.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/wp-content/php-error.php b/wp-content/php-error.php index 2a71d7d..35d10bb 100644 --- a/wp-content/php-error.php +++ b/wp-content/php-error.php @@ -11,6 +11,22 @@ // Check if we're in debug mode. $debugMode = defined('WP_DEBUG') && WP_DEBUG === true; +// Get current locale +$locale = get_locale(); + +// Define the error messages based on locale +switch ($locale) { + case 'sv_SE': // Swedish + $errorTitle = __('Sidfel', 'default'); + $errorMessage = __('Den här webbplatsen har tekniska problem och kunde inte laddas för tillfället. Försök igen senare.', 'default'); + break; + + default: // English or fallback + $errorTitle = __('Page Error', 'default'); + $errorMessage = __('This website is experiencing technical difficulties and could not be loaded at the moment. Please, try again later.', 'default'); + break; +} + ?> @@ -98,8 +114,8 @@
-

-

+

+

From dc629cd46d18c5c05a1efb855b0bbbe2f7bc0db4 Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Mon, 9 Dec 2024 13:11:04 +0100 Subject: [PATCH 3/3] Update composer.json --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 29eea53..ac0420b 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "helsingborg-stad/better-post-ui": "~3.0.3", "helsingborg-stad/blade": "3.5.1", "helsingborg-stad/broken-link-detector": "4.2.2", - "helsingborg-stad/component-library": "4.34.7", + "helsingborg-stad/component-library": "4.34.9", "helsingborg-stad/content-scheduler": "~3.1.2", "helsingborg-stad/custom-short-links": "~3.0.4", "helsingborg-stad/customer-feedback": "4.0.10", @@ -61,11 +61,11 @@ "helsingborg-stad/gdi-modularity-my-pages-about-me": "~1.0.4", "helsingborg-stad/job-listings": "~4.1.4", "helsingborg-stad/kirki": "~5.1.2", - "helsingborg-stad/like-posts": "2.8.2", + "helsingborg-stad/like-posts": "2.9.0", "helsingborg-stad/lix-calculator": "~4.1.1", "helsingborg-stad/media-usage": "~3.0.7", "helsingborg-stad/mod-my-pages": "~1.0.5", - "helsingborg-stad/modularity": "6.47.3", + "helsingborg-stad/modularity": "6.47.7", "helsingborg-stad/modularity-contact-banner": "3.2.0", "helsingborg-stad/modularity-entryscape": "^4.0.1", "helsingborg-stad/modularity-form-builder": "3.3.0", @@ -81,7 +81,7 @@ "helsingborg-stad/modularity-timeline": "4.1.0", "helsingborg-stad/multi-network-urls": "~2.0.0", "helsingborg-stad/multisite-role-propagation": "3.0.6", - "helsingborg-stad/municipio": "5.78.1", + "helsingborg-stad/municipio": "5.78.4", "helsingborg-stad/redirection-extended": "~3.0.4", "helsingborg-stad/s3-uploads-custom-endpoint": "~2.0.0", "helsingborg-stad/search-notices": "~3.0.3",