Initial commit
This commit is contained in:
121
1984-hosting-support-ui.php
Normal file
121
1984-hosting-support-ui.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 1984 Hosting Support UI class
|
||||
*
|
||||
* @package HostingSupport1984
|
||||
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html GNU General Public License v2.0
|
||||
*
|
||||
* This is where we add the "1984 Hosting Support" widget to the wp-admin
|
||||
* dashboard.
|
||||
*
|
||||
* We also plan to use this file to add more widgets and views to the wp-admin
|
||||
* interface for support and configuration options.
|
||||
*
|
||||
* Feel free to remove this file if you don't intend to use the 1984/HostingSupport1984
|
||||
* user interface additions.
|
||||
*/
|
||||
class HostingSupport1984UI {
|
||||
const VIEWS_DIR = './views/';
|
||||
|
||||
/**
|
||||
* Construct a new HostingSupport1984UI object
|
||||
*/
|
||||
public function __construct() {
|
||||
// Add the 1984 Support Information dashboard widget.
|
||||
add_action(
|
||||
'wp_dashboard_setup',
|
||||
array( $this, 'add_dashboard_widget' )
|
||||
);
|
||||
|
||||
// Enqueue the admin JS and CSS.
|
||||
add_action(
|
||||
'admin_enqueue_scripts',
|
||||
array( $this, 'enqueue_admin_scripts' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a view
|
||||
*
|
||||
* @param String $view_file The filename of the view to render.
|
||||
* @param Boolean $admin_only Only display the view to users with the manage_options capability.
|
||||
*
|
||||
* @return Boolean True if the user has access to the view. False if not.
|
||||
*/
|
||||
public function render_view( string $view_file, bool $admin_only = true ) {
|
||||
if (
|
||||
true === $admin_only && current_user_can( 'manage_options' ) ||
|
||||
false === $admin_only
|
||||
) {
|
||||
require self::view_path( $view_file );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get full file path for a view
|
||||
*
|
||||
* @param String $view_file The view file name.
|
||||
* @return String The path.
|
||||
*/
|
||||
private function view_path( $view_file ) {
|
||||
return plugin_dir_path( __FILE__ ) . self::VIEWS_DIR . $view_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user can see the 1984 admin panel
|
||||
*
|
||||
* @return [type] [description]
|
||||
*/
|
||||
private function current_user_can_view_admin_panel() {
|
||||
return ( true === current_user_can( 'manage_options' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the 1984 Hosting dashboard widget.
|
||||
*/
|
||||
public function add_dashboard_widget() {
|
||||
wp_add_dashboard_widget(
|
||||
'1984_hosting_support_widget',
|
||||
__( '1984 Hosting Support', 'hostingsupport1984' ),
|
||||
array( $this, 'render_dashboard_widget' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the 1984 Hosting dashboard widget.
|
||||
*/
|
||||
public function render_dashboard_widget() {
|
||||
$this->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();
|
||||
BIN
1984-hosting-support-widget.png
Normal file
BIN
1984-hosting-support-widget.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
109
1984-hosting-support.php
Normal file
109
1984-hosting-support.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Plugin Name: 1984 Hosting Support
|
||||
* Version: 1.0
|
||||
* Author: 1984 ehf
|
||||
* Author URI: https://1984.hosting
|
||||
* Description: Support plugin for 1984 Hosting customers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The main HostingSupport1984 class
|
||||
*
|
||||
* @package HostingSupport1984
|
||||
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html GNU General Public License v2.0
|
||||
*
|
||||
* This is where basic constants such as the version number are pulled from.
|
||||
* There are other classes that may depend on this file, so only remove it if
|
||||
* you do not intend to use the plugin.
|
||||
*/
|
||||
class HostingSupport1984 {
|
||||
const HOSTING_SUPPORT_VERSION = '0.4.0';
|
||||
|
||||
/**
|
||||
* Construct a new HostingSupport1984 object
|
||||
*/
|
||||
public function __construct() {
|
||||
// Loading the text domain for a mu-plugin is tricky.
|
||||
// We need to use admin_init instead of plugins_loaded as we are only
|
||||
// using the plugin in the admin interface.
|
||||
add_action(
|
||||
'admin_init',
|
||||
array( $this, 'load_textdomain' )
|
||||
);
|
||||
|
||||
// Register the activation hook.
|
||||
register_activation_hook(
|
||||
__FILE__,
|
||||
array( $this, 'activation_hook' )
|
||||
);
|
||||
|
||||
// Run on activation of any plugin.
|
||||
add_action(
|
||||
'activated_plugin',
|
||||
array( $this, 'plugin_activation_hook' )
|
||||
);
|
||||
|
||||
// Run on activation of theme.
|
||||
add_action(
|
||||
'switch_theme',
|
||||
array( $this, 'theme_switch_hook' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the 'hosting_support_1984' text domain
|
||||
*
|
||||
* @return Boolean
|
||||
*/
|
||||
public function load_textdomain() {
|
||||
return load_plugin_textdomain(
|
||||
'hostingsupport1984',
|
||||
false,
|
||||
'1984-hosting-support/languages'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* On activation of this plugin, set auto-update option for core,
|
||||
* plus enable auto-updates for installed plugins and themes.
|
||||
*/
|
||||
public function activation_hook() {
|
||||
// Auto-update WordPress core.
|
||||
update_site_option( 'auto_update_core_major', 'enabled' );
|
||||
|
||||
// Auto-update plugins.
|
||||
$all_plugins = apply_filters( 'all_plugins', get_plugins() );
|
||||
|
||||
update_site_option( 'auto_update_plugins', array_keys( $all_plugins ) );
|
||||
|
||||
// Auto-update themes.
|
||||
$all_themes = wp_get_themes();
|
||||
update_site_option( 'auto_update_themes', array_keys( $all_themes ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* On plugin activation, add to auto-updated list of plugins.
|
||||
*/
|
||||
public function plugin_activation_hook( $plugin ) {
|
||||
$auto_updated_plugins = (array) get_site_option( 'auto_update_plugins', array() );
|
||||
$auto_updated_plugins[] = $plugin;
|
||||
|
||||
update_site_option( 'auto_update_plugins', array_unique( $auto_updated_plugins ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* On theme switch, enable auto-update for all themes.
|
||||
*/
|
||||
public function theme_switch_hook( $theme ) {
|
||||
$all_themes = wp_get_themes();
|
||||
update_site_option( 'auto_update_themes', array_keys( $all_themes ) );
|
||||
}
|
||||
}
|
||||
|
||||
$hosting_support_1984 = new HostingSupport1984();
|
||||
|
||||
define( 'A1984_HOSTING_SUPPORT_BASE_FILE', __FILE__ );
|
||||
|
||||
require_once __DIR__ . '/1984-hosting-support-ui.php';
|
||||
364
LICENSE.txt
Normal file
364
LICENSE.txt
Normal file
@@ -0,0 +1,364 @@
|
||||
Copyright (C) 2025 - 1984 Hosting
|
||||
|
||||
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.
|
||||
|
||||
This program incorporates work covered by the following copyright and
|
||||
permission notices:
|
||||
|
||||
WordPress - Web publishing software
|
||||
Copyright 2003-2021 by the contributors
|
||||
WordPress is released under the GPL
|
||||
|
||||
================================================================================
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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.
|
||||
|
||||
<signature of Ty Coon>, 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.
|
||||
11
README.md
Normal file
11
README.md
Normal file
@@ -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:
|
||||
|
||||

|
||||
|
||||
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/).
|
||||
1
build-locales.sh
Normal file
1
build-locales.sh
Normal file
@@ -0,0 +1 @@
|
||||
msgfmt -o languages/hostingsupport1984-is_IS.mo languages/hostingsupport1984-is_IS.po
|
||||
3
deploy.sh
Executable file
3
deploy.sh
Executable file
@@ -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/.
|
||||
BIN
icons/1984-hosting-logo.webp
Normal file
BIN
icons/1984-hosting-logo.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
1
icons/contact-support.svg
Normal file
1
icons/contact-support.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><style>.cls-1{fill:#232540;}</style></defs><path class="cls-1" d="M130.95,121.55l109.34-67.11v-3.42c0-6.42-5.2-11.63-11.63-11.63H27.34c-6.42,0-11.63,5.2-11.63,11.63v3.41l109.51,67.12c1.76,1.08,3.97,1.08,5.72,0Z"/><path class="cls-1" d="M125.23,151.04L15.71,83.92v121.06c0,6.42,5.2,11.63,11.63,11.63h201.32c6.42,0,11.63-5.2,11.63-11.63v-121.04l-109.33,67.1c-1.76,1.08-3.97,1.08-5.72,0Z"/></svg>
|
||||
|
After Width: | Height: | Size: 512 B |
1
icons/knowledge-base.svg
Normal file
1
icons/knowledge-base.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><style>.cls-1{fill:#232540;}</style></defs><path class="cls-1" d="M128,24.76c-57.02,0-103.24,46.22-103.24,103.24s46.22,103.24,103.24,103.24,103.24-46.22,103.24-103.24S185.02,24.76,128,24.76ZM139.31,200.31h-22.62c-1.66,0-3-1.34-3-3v-89.15c0-1.66,1.34-3,3-3h22.62c1.66,0,3,1.34,3,3v89.15c0,1.66-1.34,3-3,3ZM139.28,84.38h-22.57c-1.67,0-3.03-1.35-3.03-3.03v-20.95c0-1.67,1.35-3.03,3.03-3.03h22.57c1.67,0,3.03,1.35,3.03,3.03v20.95c0,1.67-1.35,3.03-3.03,3.03Z"/></svg>
|
||||
|
After Width: | Height: | Size: 581 B |
1
icons/profile.svg
Normal file
1
icons/profile.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><style>.cls-1{fill:#232540;}</style></defs><path class="cls-1" d="M128,32.75c-57.02,0-103.24,46.22-103.24,103.24s46.22,103.24,103.24,103.24,103.24-46.22,103.24-103.24-46.22-103.24-103.24-103.24ZM128,71.79c16.58,0,30.02,13.44,30.02,30.02s-13.44,30.02-30.02,30.02-30.02-13.44-30.02-30.02,13.44-30.02,30.02-30.02ZM174,200.4c-30.67,17.98-61.34,17.98-92.01,0-1.2-.71-1.91-2.04-1.85-3.43,1.1-27.99,22.11-58.29,47.85-58.29s46.75,30.3,47.85,58.29c.05,1.4-.65,2.73-1.85,3.43Z"/></svg>
|
||||
|
After Width: | Height: | Size: 557 B |
1
icons/sites.svg
Normal file
1
icons/sites.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><style>.cls-1{fill:#232540;}</style></defs><path class="cls-1" d="M128,26.22c-56.61,0-102.51,45.9-102.51,102.51s45.9,102.51,102.51,102.51,102.51-45.9,102.51-102.51S184.61,26.22,128,26.22ZM152.89,51.99l1-5.93c35.15,11.04,60.73,43.92,60.73,82.67,0,9.55-1.55,18.74-4.43,27.34l-15.88,14.97c-1.22,1.15-3.03,1.39-4.51.59-1.86-1-2.94-3.01-2.74-5.11l1.77-19.34c.22-2.38,1.22-4.63,2.85-6.39l1.81-1.95c1.6-1.72,2.36-4.05,2.09-6.38l-.88-7.63c-.55-4.77-3.8-8.79-8.34-10.32l-3.72-1.26c-3.82-1.29-7.23-3.56-9.89-6.59l-4.88-5.56c-3.18-3.64-4.07-8.75-2.29-13.24l.96-2.45c1.78-4.51,1.84-9.52.16-14.07l-1.37-3.71c-1.4-3.81-4.38-6.81-8.18-8.24-3.01-1.13-4.79-4.23-4.26-7.4ZM89.18,162.15c-1.28-1.42-2.12-3.17-2.39-5.06-.51-3.52-1.37-9.42-1.84-12.59-.21-1.45-.76-2.82-1.59-4.02l-10.48-15c-1.93-2.76-2.51-6.24-1.59-9.47l3.02-10.63c.08-.25-.04-.52-.28-.64l-11.69-5.73c-1.76-.87-3.35-2.04-4.7-3.46l-5.42-5.69c-.38-.4-.68-.89-.89-1.41,12.99-24.61,37.47-42.25,66.26-45.71l2.09,6.36c1.46,3.66-.21,7.81-3.79,9.44l-17.85,8.09c-2.75,1.25-5.29,2.93-7.51,4.97l-8.71,8.02c-2.4,2.2-5.53,3.42-8.78,3.42h-5.17c-1.28,0-2.32,1.04-2.32,2.33v.79c0,.92.73,1.68,1.65,1.73l4.54.22c2.12.11,3.64,2.11,3.18,4.18-.53,2.32,1.53,4.41,3.86,3.91l12.07-2.54c4.76-1.01,9.73-.09,13.82,2.55l17.91,11.54,9.75,5.8c4.54,2.7,6.65,8.15,5.1,13.2l-.11.37-2.67,10.25c-1.2,4.59-4.74,8.2-9.31,9.48l-.7.2c-4.66,1.3-8.6,4.45-10.91,8.71l-1.09,2.02c-2.13,3.94-3.32,8.31-3.49,12.78l-.45,11.75c-.13,3.18-2.79,5.66-5.97,5.56-2.62-.09-4.85-1.93-5.44-4.48,0,0-2.4-12.1-3.45-14.87-.69-1.79-2.97-4.51-4.66-6.37ZM128,215.35c-11.26,0-22.03-2.16-31.91-6.1l.39-2.56c.39-2.49,1.82-4.68,3.95-6.02l8.73-5.52c2.8-1.77,6.5-.13,7.05,3.14.28,1.64,1.7,2.84,3.36,2.84h9.37c1.58,0,3.13-.44,4.48-1.26l1.64-.99c2.65-1.6,5.83-2.09,8.83-1.35l11.58,2.83c2.06.5,3.97,1.5,5.56,2.9l4.2,3.68c-11.29,5.39-23.91,8.41-37.23,8.41Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
19
js/1984-hosting-support.js
Normal file
19
js/1984-hosting-support.js
Normal file
@@ -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
|
||||
);
|
||||
}
|
||||
BIN
languages/hostingsupport1984-is_IS.mo
Normal file
BIN
languages/hostingsupport1984-is_IS.mo
Normal file
Binary file not shown.
41
languages/hostingsupport1984-is_IS.po
Normal file
41
languages/hostingsupport1984-is_IS.po
Normal file
@@ -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ð"
|
||||
|
||||
|
||||
41
languages/hostingsupport1984.pot
Normal file
41
languages/hostingsupport1984.pot
Normal file
@@ -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 ""
|
||||
|
||||
|
||||
27
phpcs.xml.dist
Normal file
27
phpcs.xml.dist
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="1984-hosting-support" xsi:noNamespaceSchemaLocation="phpcs.xsd">
|
||||
<description>1984 Hosting Support PHPCS Config.</description>
|
||||
|
||||
<arg name="basepath" value="."/>
|
||||
<arg value="s"/>
|
||||
|
||||
<exclude-pattern>vendor/</exclude-pattern>
|
||||
<exclude-pattern>views/</exclude-pattern>
|
||||
|
||||
<file>1984-hosting-support.php</file>
|
||||
<file>1984-hosting-support-ui.php</file>
|
||||
|
||||
<!-- Include the WordPress standard -->
|
||||
<rule ref="WordPress">
|
||||
<exclude name="WordPress.Files.FileName"/>
|
||||
<exclude name="Squiz.Commenting.FileComment"/>
|
||||
</rule>
|
||||
|
||||
<rule ref="Generic.Files.LineLength">
|
||||
<properties>
|
||||
<property name="lineLimit" value="80"/>
|
||||
<property name="absoluteLineLimit" value="120"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
</ruleset>
|
||||
57
style/1984-hosting-support.css
Normal file
57
style/1984-hosting-support.css
Normal file
@@ -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;
|
||||
}
|
||||
|
||||
67
views/support-dashboard-widget.php
Normal file
67
views/support-dashboard-widget.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* 1984 Hosting Support Plugin
|
||||
*
|
||||
* Provides a widget to easily access 1984 Hosting services.
|
||||
*
|
||||
* @package 1984-hosting-support
|
||||
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html GNU General Public License v2.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="hosting-support-1984-support-links">
|
||||
<ul id="hosting-support-1984-main-links">
|
||||
<li class="hosting-support-1984-li">
|
||||
<a href="https://management.1984.hosting/accounts/settings/" target="_blank">
|
||||
<div>
|
||||
<img class="hosting-support-1984-icon" src="<?php echo plugins_url( 'icons/profile.svg', A1984_HOSTING_SUPPORT_BASE_FILE ); ?>">
|
||||
</div>
|
||||
<div class="hosting-support-1984-text">
|
||||
<?php esc_html_e(
|
||||
'My Profile',
|
||||
'hostingsupport1984'
|
||||
); ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="hosting-support-1984-li">
|
||||
<a href="https://management.1984.hosting/dashboard/" target="_blank">
|
||||
<div><img class="hosting-support-1984-icon" src="<?php echo plugins_url( 'icons/sites.svg', A1984_HOSTING_SUPPORT_BASE_FILE ); ?>"></div>
|
||||
<div class="hosting-support-1984-text">
|
||||
<?php esc_html_e(
|
||||
'My Sites, Domains & VPSs',
|
||||
'hostingsupport1984'
|
||||
); ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="hosting-support-1984-li">
|
||||
<a href="<?php echo get_bloginfo('language') == 'is' ? 'https://kb.1984.is/doku.php?id=start' : 'https://kb.1984hosting.com/doku.php?id=start'; ?>" target="_blank">
|
||||
<div><img class="hosting-support-1984-icon" src="<?php echo plugins_url( 'icons/knowledge-base.svg', A1984_HOSTING_SUPPORT_BASE_FILE ); ?>"></div>
|
||||
<div class="hosting-support-1984-text">
|
||||
<?php esc_html_e(
|
||||
'Knowledge Base',
|
||||
'hostingsupport1984'
|
||||
); ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="hosting-support-1984-li">
|
||||
<a href="mailto:1984@1984.is" target="_blank">
|
||||
<div><img class="hosting-support-1984-icon" src="<?php echo plugins_url( 'icons/contact-support.svg', A1984_HOSTING_SUPPORT_BASE_FILE ); ?>"></div>
|
||||
<div class="hosting-support-1984-text">
|
||||
<?php esc_html_e(
|
||||
'Contact Support',
|
||||
'hostingsupport1984'
|
||||
); ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="hosting-support-1984-logo">
|
||||
<a href="<?php echo get_bloginfo('language') == 'is' ? 'https://1984.is' : 'https://1984.hosting'; ?>" target="_blank"><img src="<?php echo plugins_url( 'icons/1984-hosting-logo.webp', A1984_HOSTING_SUPPORT_BASE_FILE ); ?>"></a>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user