commit bd6c375ca75ba21176cb7ccdc9c6b643811fe7ac Author: Gudmundur D. Haraldsson Date: Mon Aug 11 11:41:25 2025 +0000 Initial commit diff --git a/1984-hosting-support-ui.php b/1984-hosting-support-ui.php new file mode 100644 index 0000000..b878347 --- /dev/null +++ b/1984-hosting-support-ui.php @@ -0,0 +1,121 @@ +render_view( 'support-dashboard-widget.php' ); + } + + /** + * Enqueue the 1984 wp-admin scripts + */ + public function enqueue_admin_scripts() { + wp_enqueue_script( + '1984-hosting-support-admin', + plugins_url( + 'js/1984-hosting-support.js', + __FILE__ + ), + array(), + HostingSupport1984::HOSTING_SUPPORT_VERSION, + true + ); + wp_enqueue_style( + '1984-hosting-support-admin', + plugins_url( + 'style/1984-hosting-support.css', + __FILE__ + ), + array(), + HostingSupport1984::HOSTING_SUPPORT_VERSION, + false + ); + } +} + +$hosting_support_1984_ui = new HostingSupport1984UI(); diff --git a/1984-hosting-support-widget.png b/1984-hosting-support-widget.png new file mode 100644 index 0000000..5501ac9 Binary files /dev/null and b/1984-hosting-support-widget.png differ diff --git a/1984-hosting-support.php b/1984-hosting-support.php new file mode 100644 index 0000000..3150563 --- /dev/null +++ b/1984-hosting-support.php @@ -0,0 +1,109 @@ + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9d00019 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# 1984 Hosting Support Plugin + +This is a plugin provided by [1984 Hosting Company](https://1984.hosting/) to improve users' support experience while using WordPress. It is primarily intended for customers of 1984 Hosting Company, though anyone can use it. If you are a 1984 customer, feel free to disable or remove the plugin on your site if you do not find it useful. + +The main function is provide a widget to users, as shown below: + +![Widget displayed in WordPress Admin](1984-hosting-support-widget.png "Widget displayed in WordPress Admin") + +A secondary function is to enable auto-updates of WordPress Core, plugins and themes. + +Support for the plugin is provided by [1984 Hosting Company](https://1984.hosting/). diff --git a/build-locales.sh b/build-locales.sh new file mode 100644 index 0000000..6d27ee7 --- /dev/null +++ b/build-locales.sh @@ -0,0 +1 @@ +msgfmt -o languages/hostingsupport1984-is_IS.mo languages/hostingsupport1984-is_IS.po diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..0af3a97 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +scp -P 2222 -r 1984*.php views js icons style languages natalee@demo-site.is@todd.shared.1984.is:/gudmundur/htdocs/wp-content/plugins/1984-hosting-support/. diff --git a/icons/1984-hosting-logo.webp b/icons/1984-hosting-logo.webp new file mode 100644 index 0000000..f4051e3 Binary files /dev/null and b/icons/1984-hosting-logo.webp differ diff --git a/icons/contact-support.svg b/icons/contact-support.svg new file mode 100644 index 0000000..c419875 --- /dev/null +++ b/icons/contact-support.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/knowledge-base.svg b/icons/knowledge-base.svg new file mode 100644 index 0000000..4e2d78b --- /dev/null +++ b/icons/knowledge-base.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/profile.svg b/icons/profile.svg new file mode 100644 index 0000000..8fef49a --- /dev/null +++ b/icons/profile.svg @@ -0,0 +1 @@ + diff --git a/icons/sites.svg b/icons/sites.svg new file mode 100644 index 0000000..aa02e02 --- /dev/null +++ b/icons/sites.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/js/1984-hosting-support.js b/js/1984-hosting-support.js new file mode 100644 index 0000000..310ba84 --- /dev/null +++ b/js/1984-hosting-support.js @@ -0,0 +1,19 @@ +/** + * wp-admin JavaScript features. + * + * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html GNU General Public License v2.0 + */ + +function HostingSupport1984CopyEmailAddress( e ) { + e.preventDefault(); + var emailAddressTag = document.querySelector( '#hosting-support-1984-address' ); + emailAddressTag.select(); + document.execCommand( 'copy' ); +} + +if (document.querySelector( '#hosting-support-1984-link' )) { + document.querySelector( '#hosting-support-1984-link' ).addEventListener( + 'click', + HostingSupport1984CopyEmailAddress + ); +} diff --git a/languages/hostingsupport1984-is_IS.mo b/languages/hostingsupport1984-is_IS.mo new file mode 100644 index 0000000..bc9b2ab Binary files /dev/null and b/languages/hostingsupport1984-is_IS.mo differ diff --git a/languages/hostingsupport1984-is_IS.po b/languages/hostingsupport1984-is_IS.po new file mode 100644 index 0000000..ff32444 --- /dev/null +++ b/languages/hostingsupport1984-is_IS.po @@ -0,0 +1,41 @@ +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" +"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" + +#: 1984-hosting-support-ui.php:100 +msgid "1984 Hosting Support" +msgstr "Aðstoð og stuðningur hjá 1984" + +#. Name of the plugin +msgid "1984-hosting-support.php" +msgstr "" + +#: views/support-dashboard-widget.php:31 +msgid "My Profile" +msgstr "Minn aðgangur" + +#: views/support-dashboard-widget.php:15 +msgid "My Sites, Domains & VPSs" +msgstr "Vefir, lén og sýndarvélar" + +#: views/support-dashboard-widget.php:15 +msgid "Knowledge Base" +msgstr "Viskubrunnur 1984" + +#: views/support-dashboard-widget.php:15 +msgid "Contact Support" +msgstr "Fá aðstoð" + + diff --git a/languages/hostingsupport1984.pot b/languages/hostingsupport1984.pot new file mode 100644 index 0000000..15d27ae --- /dev/null +++ b/languages/hostingsupport1984.pot @@ -0,0 +1,41 @@ +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" +"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" + +#: 1984-hosting-support-ui.php:100 +msgid "1984 Hosting Support" +msgstr "Aðstoð og stuðningur hjá 1984" + +#. Name of the plugin +msgid "1984-hosting-support.php" +msgstr "" + +#: views/support-dashboard-widget.php:31 +msgid "My Profile" +msgstr "" + +#: views/support-dashboard-widget.php:15 +msgid "My Sites, Domains & VPSs" +msgstr "" + +#: views/support-dashboard-widget.php:15 +msgid "Knowledge Base" +msgstr "" + +#: views/support-dashboard-widget.php:15 +msgid "Contact Support" +msgstr "" + + diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..f6afc72 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,27 @@ + + + 1984 Hosting Support PHPCS Config. + + + + + vendor/ + views/ + + 1984-hosting-support.php + 1984-hosting-support-ui.php + + + + + + + + + + + + + + + diff --git a/style/1984-hosting-support.css b/style/1984-hosting-support.css new file mode 100644 index 0000000..49ca127 --- /dev/null +++ b/style/1984-hosting-support.css @@ -0,0 +1,57 @@ +/** + * CSS styles used by 1984-hosting-support plugin. + * + * (C) 2025 - 1984 Hosting + * + * Published under the GNU General Public License v2.0 + * https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +**/ + +#hostingsupport1984_support_widget { + background: #fffbee; +} + +#adminmenu a.toplevel_page_hostingsupport1984_manage { + background-color: #b48701; + font-weight: bold; +} + +#adminmenu a.toplevel_page_hostingsupport1984_manage:hover { + color: #fff; +} + +#adminmenu a.toplevel_page_hostingsupport1984_manage div.wp-menu-image::before { + color: #fff; +} + +#hosting-support-1984-main-links { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 0.2rem; + list-style-type: none; +} + +.hosting-support-1984-li { +} + +.hosting-support-1984-icon { + width: 5.3em; + height: auto; + display: block; + margin: auto; +} + +.hosting-support-1984-text { + text-align: center; +} + +#hosting-support-1984-logo { + display: flex; + justify-content: flex-end; +} + +#hosting-support-1984-logo img { + width: auto; + height: 1.5em; +} + diff --git a/views/support-dashboard-widget.php b/views/support-dashboard-widget.php new file mode 100644 index 0000000..2fcaacc --- /dev/null +++ b/views/support-dashboard-widget.php @@ -0,0 +1,67 @@ + + +