First draft

This commit is contained in:
2025-12-02 11:24:58 +00:00
parent 801c24885b
commit 1821e15e70
6 changed files with 111 additions and 51 deletions

View File

@@ -87,7 +87,7 @@ class HostingSupport1984UI
*
* @return String The path.
*/
private function view_path(string $view_file)
private function view_path(string $view_file): string
{
return plugin_dir_path(__FILE__) . self::VIEWS_DIR . $view_file;
}

View File

@@ -2,11 +2,13 @@
/*
* Plugin Name: 1984 Hosting Support
* Version: 1.0.1
* Author: 1984 ehf
* Version: 1.1.0
* Author: 1984 ehf.
* Author URI: https://1984.hosting
* Description: Support plugin for 1984 Hosting customers.
* Update URI: https://git.1984.is/1984/1984-hosting-support/
* Text Domain: hostingsupport1984
* Domain Path: /languages
*/
/**
@@ -97,7 +99,7 @@ class HostingSupport1984
*
* @return Boolean
*/
public function load_textdomain()
public function load_textdomain(): bool
{
return load_plugin_textdomain(
'hostingsupport1984',
@@ -191,25 +193,34 @@ class HostingSupport1984
return $links;
}
$warning_text = '1984: Please do not deactivate or delete this plugin - part of your WordPress Service Pack.';
$warning_text =
__('1984 Hosting: Please do not deactivate or delete this plugin - part of your WordPress Service Pack.', 'hostingsupport1984');
$logo_1984_url = plugins_url('icons/1984-hosting-logo.webp', __FILE__);
$logo_patchstack = plugins_url('icons/patchstack-logo.svg', __FILE__);
$warning_icon =
'<span class="dashicons dashicons-warning" aria-hidden="true" style="color:#b32d2e;vertical-align:text-bottom;margin-right:6px;"></span>';
$title_1984 = __('Visit 1984 Hosting Homepage', 'hostingsupport1984');
$title_patchstack = __('Visit Patchstack Homepage', 'hostingsupport1984');
$links[] =
'<span class="description" style="color:#b32d2e;font-weight:700;display:inline-flex;align-items:center;line-height:1;">' . $warning_icon . esc_html($warning_text) . '</span>' .
'<span class="description" style="margin-left:6px;display:inline-flex;align-items:center;gap:4px;">'
$container_open =
'<span class="description" style="color:#b32d2e;font-weight:700;display:inline-grid;grid-template-columns:auto 1fr;column-gap:6px;row-gap:4px;align-items:center;line-height:1.5;vertical-align:middle;">';
$warning_icon =
'<span class="dashicons dashicons-warning" aria-hidden="true" style="color:#b32d2e;grid-column:1;"></span>';
$text_html = '<span style="grid-column:2;">' . esc_html($warning_text) . '</span>';
$logos_html =
'<span style="grid-column:2;display:inline-flex;align-items:center;gap:4px;">'
.
'<a href="https://1984.hosting" target="_blank" rel="noopener noreferrer" title="1984 Hosting" aria-label="1984 Hosting (opens in a new tab)">'
'<a href="https://1984.hosting" target="_blank" rel="noopener noreferrer" title="' . esc_attr($title_1984) . '" aria-label="' . esc_attr($title_1984) . '">'
.
'<img src="' . esc_url($logo_1984_url) . '" alt="1984 Hosting" style="height:16px;width:auto;display:inline-block;" />'
.
'</a>'
.
'<a href="https://patchstack.com" target="_blank" rel="noopener noreferrer" title="Patchstack" aria-label="Patchstack (opens in a new tab)">'
'<a href="https://patchstack.com" target="_blank" rel="noopener noreferrer" title="' . esc_attr($title_patchstack) . '" aria-label="' . esc_attr($title_patchstack) . '">'
.
'<img src="' . esc_url($logo_patchstack) . '" alt="Patchstack" style="height:16px;width:auto;display:inline-block;" />'
.
@@ -217,6 +228,8 @@ class HostingSupport1984
.
'</span>';
$links[] = $container_open . $warning_icon . $text_html . $logos_html . '</span>';
return $links;
}

0
build-locales.sh Normal file → Executable file
View File

View File

@@ -1,41 +1,69 @@
# Copyright (C) 2025 1984 ehf.
# This file is distributed under the same license as the 1984 Hosting Support plugin.
msgid ""
msgstr ""
"Project-Id-Version: 1984 Big Brother\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-19 10:05+0000\n"
"PO-Revision-Date: 2021-01-19 10:09+0000\n"
"Last-Translator: \n"
"Language-Team: Íslenska\n"
"Language: is_IS\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"Project-Id-Version: 1984 Hosting Support 1.1.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/1984-hosting-"
"support\n"
"Last-Translator: Sævar Bergur Sigurgeirsson <saevar@1984.is>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.4.2; wp-5.6"
"POT-Creation-Date: 2025-12-02T11:00:44+00:00\n"
"PO-Revision-Date: 2025-12-02T11:00:44+00:00\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: hostingsupport1984\n"
"Language: is\n"
#: 1984-hosting-support-ui.php:100
#. Plugin Name of the plugin
#: 1984-hosting-support.php 1984-hosting-support-ui.php:49
msgid "1984 Hosting Support"
msgstr "Aðstoð og stuðningur hjá 1984"
msgstr "Aðstoð og stuðningur hjá 1984 Hosting"
#. Name of the plugin
msgid "1984-hosting-support.php"
#. Description of the plugin
#: 1984-hosting-support.php
msgid "Support plugin for 1984 Hosting customers."
msgstr "Stuðningsviðbót fyrir viðskiptavini 1984 Hosting."
#. Author of the plugin
#: 1984-hosting-support.php
msgid "1984 ehf."
msgstr ""
#: views/support-dashboard-widget.php:31
#. Author URI of the plugin
#: 1984-hosting-support.php
msgid "https://1984.hosting"
msgstr ""
#: 1984-hosting-support.php:194
msgid ""
"1984 Hosting: Please do not deactivate or delete this plugin - part of your "
"WordPress Service Pack."
msgstr ""
"1984 Hosting: Vinsamlegast ekki slökkva á eða eyða þessari viðbót hún er "
"hluti af WordPress þjónustupakkanum þínum."
#: 1984-hosting-support.php:309
msgid ""
"For security, this action is blocked: 1984 Hosting Support and Patchstack "
"cannot be deactivated or deleted while this policy is active."
msgstr ""
"Af öryggisástæðum er þessari aðgerð hafnað: 1984 Hosting Support og Patchstack "
"er ekki hægt að slökkva á eða eyða meðan þessi regla er virk."
#: views/support-dashboard-widget.php:21
msgid "My Profile"
msgstr "Minn aðgangur"
#: views/support-dashboard-widget.php:15
#: views/support-dashboard-widget.php:34
msgid "My Sites, Domains & VPSs"
msgstr "Vefir, lén og sýndarvélar"
#: views/support-dashboard-widget.php:15
#: views/support-dashboard-widget.php:48
msgid "Knowledge Base"
msgstr "Viskubrunnur 1984"
#: views/support-dashboard-widget.php:15
#: views/support-dashboard-widget.php:62
msgid "Contact Support"
msgstr "Fá aðstoð"

View File

@@ -1,41 +1,60 @@
# Copyright (C) 2025 1984 ehf.
# This file is distributed under the same license as the 1984 Hosting Support plugin.
msgid ""
msgstr ""
"Project-Id-Version: 1984 Big Brother\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-19 10:05+0000\n"
"PO-Revision-Date: 2021-01-19 10:09+0000\n"
"Last-Translator: \n"
"Language-Team: Íslenska\n"
"Language: is_IS\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"Project-Id-Version: 1984 Hosting Support 1.1.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/1984-hosting-support\n"
"Last-Translator: Sævar Bergur Sigurgeirsson <saevar@1984.is>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.4.2; wp-5.6"
"POT-Creation-Date: 2025-12-02T11:00:44+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: hostingsupport1984\n"
#: 1984-hosting-support-ui.php:100
#. Plugin Name of the plugin
#: 1984-hosting-support.php
#: 1984-hosting-support-ui.php:49
msgid "1984 Hosting Support"
msgstr "Aðstoð og stuðningur hjá 1984"
#. Name of the plugin
msgid "1984-hosting-support.php"
#. Description of the plugin
#: 1984-hosting-support.php
msgid "Support plugin for 1984 Hosting customers."
msgstr ""
#: views/support-dashboard-widget.php:31
#. Author of the plugin
#: 1984-hosting-support.php
msgid "1984 ehf."
msgstr ""
#. Author URI of the plugin
#: 1984-hosting-support.php
msgid "https://1984.hosting"
msgstr ""
#: 1984-hosting-support.php:194
msgid "1984 Hosting: Please do not deactivate or delete this plugin - part of your WordPress Service Pack."
msgstr ""
#: 1984-hosting-support.php:309
msgid "For security, this action is blocked: 1984 Hosting Support and Patchstack cannot be deactivated or deleted while this policy is active."
msgstr ""
#: views/support-dashboard-widget.php:21
msgid "My Profile"
msgstr ""
#: views/support-dashboard-widget.php:15
#: views/support-dashboard-widget.php:34
msgid "My Sites, Domains & VPSs"
msgstr ""
#: views/support-dashboard-widget.php:15
#: views/support-dashboard-widget.php:48
msgid "Knowledge Base"
msgstr ""
#: views/support-dashboard-widget.php:15
#: views/support-dashboard-widget.php:62
msgid "Contact Support"
msgstr ""