Initial commit: Atomaste website
This commit is contained in:
@@ -0,0 +1,658 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) or die( );
|
||||
|
||||
if ( ! class_exists( "rsssl_le_hosts" ) ) {
|
||||
|
||||
class rsssl_le_hosts {
|
||||
private static $_this;
|
||||
public $steps;
|
||||
public $hosts;
|
||||
public $supported_hosts;
|
||||
public $not_local_certificate_hosts;
|
||||
public $no_installation_renewal_needed;
|
||||
public $dashboard_activation_required;
|
||||
public $activated_by_default;
|
||||
public $paid_only;
|
||||
|
||||
public function __construct() {
|
||||
if ( !defined('RSSSL_LE_CONFIG_LOADED') ) {
|
||||
define('RSSSL_LE_CONFIG_LOADED', true);
|
||||
}
|
||||
|
||||
if ( isset( self::$_this ) ) {
|
||||
wp_die( 'This is a singleton class and you cannot create a second instance.');
|
||||
}
|
||||
|
||||
self::$_this = $this;
|
||||
|
||||
/**
|
||||
* Plesk requires local SSL generation, and installation renewal.
|
||||
* Cpanel default requires local SSL generation, and installation renewal.
|
||||
* Cpanel autossl: no local ssl generation, no renewal
|
||||
*/
|
||||
|
||||
$this->hosts = array(
|
||||
'cloudways' => array(
|
||||
'name' => 'CloudWays',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cloudways',
|
||||
'api' => true,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'tierpoint' => array(
|
||||
'name' => 'TierPoint',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => true,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'godaddy' => array(
|
||||
'name' => 'GoDaddy',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'godaddy_managed' => array(
|
||||
'name' => 'GoDaddy Managed WordPress',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => 'godaddymanaged',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'kasserver' => array(
|
||||
'name' => 'Kasserver',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'kasserver',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://kas.all-inkl.com/',
|
||||
),
|
||||
'argeweb' => array(
|
||||
'name' => 'Argeweb',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'plesk',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://www.argeweb.nl/argecs/',
|
||||
),
|
||||
|
||||
'hostgator' => array(
|
||||
'name' => 'HostGator',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => true,
|
||||
'hosting_dashboard' => 'cpanel:autossl',
|
||||
'api' => true,
|
||||
'ssl_installation_link' => 'https://{host}:2083/frontend/paper_lantern/security/tls_status/',
|
||||
),
|
||||
|
||||
'ionos' => array(
|
||||
'name' => 'IONOS',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'ionos',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => '',
|
||||
),
|
||||
|
||||
'simply' => array(
|
||||
'name' => 'Simply',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => false,
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://www.simply.com/en/controlpanel/sslcerts/',
|
||||
),
|
||||
'siteground' => array(
|
||||
'name' => 'SiteGround',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => false,
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://tools.siteground.com/ssl',
|
||||
),
|
||||
'dreamhost' => array(
|
||||
'name' => 'Dreamhost',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => false,
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://help.dreamhost.com/hc/en-us/articles/216539548-Adding-a-free-Let-s-Encrypt-certificate',
|
||||
),
|
||||
'wpengine' => array(
|
||||
'name' => 'WPEngine',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => false,
|
||||
'api' => false,
|
||||
'detected' => isset($_SERVER['IS_WPE']),
|
||||
'ssl_installation_link' => 'https://wpengine.com/support/add-ssl-site/#letsencrypt',
|
||||
),
|
||||
'ipage' => array(
|
||||
'name' => 'iPage',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => false,
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://www.ipage.com/help/article/enable-your-free-ssl-certificate',
|
||||
),
|
||||
'onecom' => array(
|
||||
'name' => 'one.com',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => false,
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://help.one.com/hc/en-us/articles/360000297458-Why-is-SSL-HTTPS-not-working-on-my-site-',
|
||||
),
|
||||
'wpmudev' => array(
|
||||
'name' => 'WPMUDEV',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => false,
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://wpmudev.com',
|
||||
),
|
||||
'ovh' => array(
|
||||
'name' => 'OVH',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://ovh.com',
|
||||
),
|
||||
'bluehost' => array(
|
||||
'name' => 'BlueHost',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://www.bluehost.com/help/article/how-to-activate-a-free-wordpress-ssl',
|
||||
),
|
||||
'freeola' => array(
|
||||
'name' => 'Freeola',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'freeola',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => '',
|
||||
),
|
||||
'hostinger' => array(
|
||||
'name' => 'Hostinger',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'hpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://hpanel.hostinger.com/hosting/{domain}advanced/ssl',
|
||||
),
|
||||
'pcextreme' => array(
|
||||
'name' => 'PCExtreme',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => 'directadmin',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://help.pcextreme.nl/domains-ssl/hoe-vraag-ik-een-ssl-certificaat-aan-voor-mijn-domein/',
|
||||
),
|
||||
'internic' => array(
|
||||
'name' => 'Internic',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => 'internic',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://internic.com',
|
||||
),
|
||||
'aruba' => array(
|
||||
'name' => 'Aruba',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'aruba',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://admin.aruba.it/PannelloAdmin/UI/Pages/ContentSection.aspx?Action=153',
|
||||
),
|
||||
'namecheap' => array(
|
||||
'name' => 'Namecheap',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://www.namecheap.com/blog/install-free-ssls/',
|
||||
),
|
||||
'hostpapa' => array(
|
||||
'name' => 'Hostpapa',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'webcom' => array(
|
||||
'name' => 'web.com',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'web.com',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'crazydomains' => array(
|
||||
'name' => 'Crazydomains',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'crazydomains',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'strato' => array(
|
||||
'name' => 'Strato',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'plesk',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'inmotion' => array(
|
||||
'name' => 'Inmotion',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://www.inmotionhosting.com/support/website/ssl/auto-ssl-guide/',
|
||||
),
|
||||
'flywheel' => array(
|
||||
'name' => 'Flywheel',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'flywheel',
|
||||
'api' => false,
|
||||
'detected' => isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Flywheel/') === 0,
|
||||
'ssl_installation_link' => 'https://getflywheel.com/why-flywheel/simple-ssl/',
|
||||
),
|
||||
'kinsta' => array(
|
||||
'name' => 'Kinsta',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'mykinsta',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'pressable' => array(
|
||||
'name' => 'Pressable',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'pressable',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
'detected' => (defined('IS_ATOMIC') && IS_ATOMIC) || (defined('IS_PRESSABLE') && IS_PRESSABLE),
|
||||
),
|
||||
'wpx' => array(
|
||||
'name' => 'WPX',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'wpx',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'greengeeks' => array(
|
||||
'name' => 'Greengeeks',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'greengeeks',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://www.greengeeks.com/support/article/getting-started-adding-lets-encrypt-ssl-greengeeks-account/',
|
||||
),
|
||||
'liquidweb' => array(
|
||||
'name' => 'Liquidweb',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'profreehost' => array(
|
||||
'name' => 'Profreehost',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://profreehost.com/support/ssl-https/how-to-install-an-ssl-certificate/',
|
||||
),
|
||||
'hostdash' => array(
|
||||
'name' => 'Hostdash',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'byethost' => array(
|
||||
'name' => 'Byethost',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => 'byethost',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'site5' => array(
|
||||
'name' => 'Site5',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => '',
|
||||
),
|
||||
'epizy' => array(
|
||||
'name' => 'Epizy',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => '',
|
||||
),
|
||||
'infinityfree' => array(
|
||||
'name' => 'Infinityfree',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => '',
|
||||
),
|
||||
'gandi' => array(
|
||||
'name' => 'Gandi',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'gandi',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'contabo' => array(
|
||||
'name' => 'Contabo',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => true,
|
||||
'hosting_dashboard' => 'cpanel:autossl',
|
||||
'api' => true,
|
||||
'ssl_installation_link' => 'https://{host}:2083/frontend/paper_lantern/security/tls_status/',
|
||||
),
|
||||
'earthlink' => array(
|
||||
'name' => 'Earthlink',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => true,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'hostway' => array(
|
||||
'name' => 'Hostway',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'beget' => array(
|
||||
'name' => 'Beget',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'beget',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'fatcow' => array(
|
||||
'name' => 'Fatcow',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'fatcow',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'ventraip' => array(
|
||||
'name' => 'Ventraip',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activated_by_default',
|
||||
'hosting_dashboard' => 'cpanel:autossl',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://{host}:2083/frontend/paper_lantern/security/tls_status/',
|
||||
),
|
||||
'namescouk' => array(
|
||||
'name' => 'Names.co.uk',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'mediatemple' => array(
|
||||
'name' => 'Mediatemple',
|
||||
'installation_renewal_required' => true,
|
||||
'local_ssl_generation_needed' => true,
|
||||
'free_ssl_available' => false,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'xxl' => array(
|
||||
'name' => 'XXL Hosting',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => true,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'combell' => array(
|
||||
'name' => 'Combell',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => true,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'detected' => defined('HBRW_PLATFORM_ID') && (int) HBRW_PLATFORM_ID === 1,
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'easyhost' => array(
|
||||
'name' => 'EasyHost',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => true,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'detected' => defined('HBRW_PLATFORM_ID') && (int) HBRW_PLATFORM_ID === 2,
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'transip' => array(
|
||||
'name' => 'TransIP',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => true,
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'digitalocean' => array(
|
||||
'name' => 'Digitalocean',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'digitalocean',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://docs.digitalocean.com/products/accounts/security/certificates/',
|
||||
),
|
||||
'fisthost' => array(
|
||||
'name' => 'Fisthost',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'fisthost',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://my.fisthost.com/knowledgebase/6/How-do-I-activate-my-free-SSL.html',
|
||||
),
|
||||
'register' => array(
|
||||
'name' => 'register.lk',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => '',
|
||||
),
|
||||
'fasthosts' => array(
|
||||
'name' => 'Fasthosts',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'cpanel',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => false,
|
||||
),
|
||||
'upress' => array(
|
||||
'name' => 'Upress',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'false',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://support.upress.io',
|
||||
),
|
||||
'infomaniak' => array(
|
||||
'name' => 'Infomaniak',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_required',
|
||||
'hosting_dashboard' => 'infomaniak',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => 'https://www.infomaniak.com/en/secure/ssl-certificates',
|
||||
),
|
||||
'dandomain' => array(
|
||||
'name' => 'DanDomain',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'paid_only',
|
||||
'hosting_dashboard' => 'dandomain',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => '',
|
||||
),
|
||||
'hetzner' => array(
|
||||
'name' => 'Hetzner',
|
||||
'installation_renewal_required' => false,
|
||||
'local_ssl_generation_needed' => false,
|
||||
'free_ssl_available' => 'activation_reguired',
|
||||
'hosting_dashboard' => 'konsoleh',
|
||||
'api' => false,
|
||||
'ssl_installation_link' => '',
|
||||
),
|
||||
);
|
||||
|
||||
$this->not_local_certificate_hosts = $this->filter_hosts( 'local_ssl_generation_needed', false);
|
||||
$this->dashboard_activation_required = $this->filter_hosts( 'free_ssl_available', 'activation_required');
|
||||
$this->activated_by_default = $this->filter_hosts( 'free_ssl_available', 'activated_by_default');
|
||||
$this->paid_only = $this->filter_hosts( 'free_ssl_available', 'paid_only');
|
||||
$this->no_installation_renewal_needed = $this->filter_hosts( 'installation_renewal_required', false);
|
||||
$this->no_installation_renewal_needed[] = 'cpanel:autossl';
|
||||
|
||||
ksort($this->hosts);
|
||||
$this->supported_hosts = array(
|
||||
'none' => __('I don\'t know, or not listed, proceed with installation', 'really-simple-ssl'),
|
||||
);
|
||||
$this->supported_hosts = $this->supported_hosts + wp_list_pluck($this->hosts, 'name');
|
||||
}
|
||||
|
||||
static function this() {
|
||||
return self::$_this;
|
||||
}
|
||||
|
||||
public function detect_host_on_activation(){
|
||||
foreach ( $this->hosts as $host_key => $host ) {
|
||||
if ( isset($host['detected']) && $host['detected'] ) {
|
||||
rsssl_update_option('other_host_type', $host_key );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param mixed $filter_value
|
||||
* @param mixed $filter_key
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function filter_hosts( $filter_key, $filter_value){
|
||||
return array_keys(array_filter($this->hosts, function ($var) use ($filter_value, $filter_key) {
|
||||
return ($var[$filter_key] == $filter_value);
|
||||
}) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string | bool $type
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
public function host_api_supported( $type ) {
|
||||
$hosting_company = rsssl_get_other_host();
|
||||
//if not listed, we assume it can.
|
||||
if ( !$hosting_company || $hosting_company === 'none' ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$hosts_has_dashboard = RSSSL_LE()->hosts->filter_hosts( 'api', $type);
|
||||
if ( in_array($hosting_company, $hosts_has_dashboard) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} //class closure
|
||||
@@ -0,0 +1,561 @@
|
||||
<?php
|
||||
|
||||
function rsssl_le_steps(){
|
||||
$steps =
|
||||
[
|
||||
[
|
||||
"id" => "system-status",
|
||||
"title" => __( "System status", 'really-simple-ssl' ),
|
||||
],
|
||||
[
|
||||
"id" => "domain",
|
||||
"title" => __( "General Settings", 'really-simple-ssl' ),
|
||||
],
|
||||
|
||||
[
|
||||
"id" => "directories",
|
||||
"title" => __( "Directories", 'really-simple-ssl' ),
|
||||
],
|
||||
[
|
||||
"id" => "dns-verification",
|
||||
"title" => __( "DNS verification", 'really-simple-ssl' ),
|
||||
],
|
||||
[
|
||||
"id" => "generation",
|
||||
"title" => __( "Generation", 'really-simple-ssl' ),
|
||||
],
|
||||
[
|
||||
"id" => "installation",
|
||||
"title" => __( "Installation", 'really-simple-ssl' ),
|
||||
],
|
||||
];
|
||||
|
||||
return $steps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Let's Encrypt
|
||||
*/
|
||||
add_filter("rsssl_fields", "rsssl_le_add_fields");
|
||||
function rsssl_le_add_fields($fields) {
|
||||
|
||||
$fields = array_merge($fields, [
|
||||
[
|
||||
'id' => 'system-status',
|
||||
'menu_id' => 'le-system-status',
|
||||
'group_id' => 'le-system-status',
|
||||
"intro" => __( "Detected status of your setup.", "really-simple-ssl" ),
|
||||
'type' => 'letsencrypt',
|
||||
'default' => false,
|
||||
'actions' => [
|
||||
[
|
||||
'description' => __( "Checking SSL certificate...", "really-simple-ssl" ),
|
||||
'action' => 'certificate_status',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __( "Checking if CURL is available...", "really-simple-ssl" ),
|
||||
'action' => 'curl_exists',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __( "Checking server software...", "really-simple-ssl" ),
|
||||
'action' => 'server_software',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __( "Checking alias domain...", "really-simple-ssl" ),
|
||||
'action' => 'alias_domain_available',
|
||||
'attempts' => 3,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __( "Checking for website configuration...", "really-simple-ssl" ),
|
||||
'action' => 'check_domain',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'verification_type',
|
||||
'menu_id' => 'le-general',
|
||||
'group_id' => 'le-general',
|
||||
'type' => 'hidden',
|
||||
],
|
||||
[
|
||||
'id' => 'email_address',
|
||||
'menu_id' => 'le-general',
|
||||
'group_id' => 'le-general',
|
||||
'type' => 'email',
|
||||
'label' => __( "Email address", 'really-simple-ssl' ),
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'title' => __( "Email address", "really-simple-ssl" ),
|
||||
'text' => __( "This email address is used to create a Let's Encrypt account. This is also where you will receive renewal notifications.", 'really-simple-ssl' ),
|
||||
],
|
||||
'default' => '',
|
||||
'required' => true,
|
||||
],
|
||||
[
|
||||
'id' => 'accept_le_terms',
|
||||
'menu_id' => 'le-general',
|
||||
'group_id' => 'le-general',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'required' => true,
|
||||
'label' => __( 'I agree to the Terms & Conditions from Let\'s Encrypt.','really-simple-ssl'),
|
||||
'comment' => '<a target="_blank" href="https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf">'.__('Terms & Conditions', "really-simple-ssl" ).'</a>',
|
||||
],
|
||||
[
|
||||
'id' => 'disable_ocsp',
|
||||
'menu_id' => 'le-general',
|
||||
'group_id' => 'le-general',
|
||||
'required'=> false,
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'url' => 'ocsp-stapling',
|
||||
'title' => __( "Disable OCSP stapling", "really-simple-ssl" ),
|
||||
'text' => __( "OCSP stapling is configured as enabled by default. You can disable this option if this is not supported by your hosting provider.", "really-simple-ssl" ),
|
||||
],
|
||||
'label' => __( "Disable OCSP stapling", 'really-simple-ssl' ),
|
||||
],
|
||||
[
|
||||
'id' => 'domain',
|
||||
'menu_id' => 'le-general',
|
||||
'group_id' => 'le-general',
|
||||
'type' => 'text',
|
||||
'default' => rsssl_get_domain(),
|
||||
'label' => __( "Domain", 'really-simple-ssl' ),
|
||||
|
||||
'required' => false,
|
||||
'disabled' => true,
|
||||
],
|
||||
[
|
||||
'id' => 'include_alias',
|
||||
'menu_id' => 'le-general',
|
||||
'group_id' => 'le-general',
|
||||
'type' => 'checkbox',
|
||||
'default' => '',
|
||||
'label' => __( "Include alias", 'really-simple-ssl' ),
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'title' => __( "Include alias", "really-simple-ssl" ),
|
||||
'text' => __( "This will include both the www. and non-www. version of your domain.", "really-simple-ssl" ) . ' '
|
||||
. __( "You should have the www domain pointed to the same website as the non-www domain.", 'really-simple-ssl' ),
|
||||
],
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_is_subdomain()' => false,
|
||||
'rsssl_wildcard_certificate_required()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'cpanel_host',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'label' => __( "CPanel host", 'really-simple-ssl' ),
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'title' => __( "CPanel host", "really-simple-ssl" ),
|
||||
'text' => __( "The URL you use to access your cPanel dashboard. Ends on :2083.", 'really-simple-ssl' ),
|
||||
],
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_is_cpanel()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'cpanel_username',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'label' => __( "CPanel username", 'really-simple-ssl' ),
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_cpanel_api_supported()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'cpanel_password',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'password',
|
||||
'default' => '',
|
||||
'label' => __( "CPanel password", 'really-simple-ssl' ),
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_cpanel_api_supported()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'directadmin_host',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'label' => __( "DirectAdmin host", 'really-simple-ssl' ),
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'title' => __( "Direct Admin URL", "really-simple-ssl" ),
|
||||
'text' => __( "The URL you use to access your DirectAdmin dashboard. Ends on :2222.", 'really-simple-ssl' ),
|
||||
],
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_is_directadmin()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'directadmin_username',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'label' => __( "DirectAdmin username", 'really-simple-ssl' ),
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_is_directadmin()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'directadmin_password',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'password',
|
||||
'default' => '',
|
||||
'label' => __( "DirectAdmin password", 'really-simple-ssl' ),
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_is_directadmin()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'cloudways_user_email',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'placeholder' => 'email@email.com',
|
||||
'label' => __( "CloudWays user email", 'really-simple-ssl' ),
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'other_host_type' => 'cloudways',
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'cloudways_api_key',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'password',
|
||||
'default' => '',
|
||||
'label' => __( "CloudWays API key", 'really-simple-ssl' ),
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'title' => __( "CloudWays API key", "really-simple-ssl" ),
|
||||
'text' => sprintf( __( "You can find your api key %shere%s (make sure you're logged in with your main account).", "really-simple-ssl" ),
|
||||
'<a target="_blank" href="https://platform.cloudways.com/api">', '</a>' ),
|
||||
],
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'other_host_type' => 'cloudways',
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'plesk_host',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'label' => __( "Plesk host", 'really-simple-ssl' ),
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'title' => __( "Plesk admin URL", "really-simple-ssl" ),
|
||||
'text' => __( "The URL you use to access your Plesk dashboard. Ends on :8443.", 'really-simple-ssl' ),
|
||||
],
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_is_plesk()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'plesk_username',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'label' => __( "Plesk username", 'really-simple-ssl' ),
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'title' => __( "Plesk username and password", "really-simple-ssl" ),
|
||||
'text' => sprintf( __( "You can find your Plesk username and password in %s", 'really-simple-ssl' ), 'https://{your-plesk-host-name}:8443/smb/my-profile' ),
|
||||
],
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_is_plesk()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'plesk_password',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'password',
|
||||
'default' => '',
|
||||
'label' => __( "Plesk password", 'really-simple-ssl' ),
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_is_plesk()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'store_credentials',
|
||||
'menu_id' => 'le-hosting',
|
||||
'group_id' => 'le-hosting',
|
||||
'type' => 'checkbox',
|
||||
'default' => '',
|
||||
'label' => __( "Do you want to store these credentials for renewal purposes?", 'really-simple-ssl' ),
|
||||
'help' => [
|
||||
'label' => 'default',
|
||||
'title' => 'Storing credentials',
|
||||
'text' => __( "Store for renewal purposes. If not stored, renewal may need to be done manually.", 'really-simple-ssl' ),
|
||||
],
|
||||
'required' => false,
|
||||
'disabled' => false,
|
||||
'server_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'rsssl_uses_known_dashboard()' => true,
|
||||
'rsssl_activated_by_default()' => false,
|
||||
'rsssl_activation_required()' => false,
|
||||
'rsssl_paid_only()' => false,
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'directories',
|
||||
'menu_id' => 'le-directories',
|
||||
'group_id' => 'le-directories',
|
||||
'condition_action' => 'hide',
|
||||
'type' => 'letsencrypt',
|
||||
'actions' => [
|
||||
[
|
||||
'description' => __( "Checking host...", "really-simple-ssl" ),
|
||||
'action' => 'check_host',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __( "Checking challenge directory...", "really-simple-ssl" ),
|
||||
'action' => 'check_challenge_directory',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __( "Checking key directory...", "really-simple-ssl" ),
|
||||
'action' => 'check_key_directory',
|
||||
'attempts' => 2,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __( "Checking certs directory...", "really-simple-ssl" ),
|
||||
'action' => 'check_certs_directory',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __( "Checking permissions...", "really-simple-ssl" ),
|
||||
'action' => 'check_writing_permissions',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
|
||||
[
|
||||
'description' => __( "Checking challenge directory reachable over http...", "really-simple-ssl" ),
|
||||
'action' => 'challenge_directory_reachable',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
],
|
||||
'react_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'!verification_type' => 'dns',
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'dns-verification',
|
||||
'menu_id' => 'le-dns-verification',
|
||||
'group_id' => 'le-dns-verification',
|
||||
'type' => 'letsencrypt',
|
||||
'condition_action' => 'hide',
|
||||
'actions' => [
|
||||
[
|
||||
'description' => __("Creating account...", "really-simple-ssl"),
|
||||
'action'=> 'get_account',
|
||||
'attempts' => 5,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __("Retrieving DNS verification token...", "really-simple-ssl"),
|
||||
'action'=> 'get_dns_token',
|
||||
'attempts' => 5,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
],
|
||||
'react_conditions' => [
|
||||
'relation' => 'AND',
|
||||
[
|
||||
'verification_type' => 'dns',
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'generation',
|
||||
'menu_id' => 'le-generation',
|
||||
'group_id' => 'le-generation',
|
||||
'type' => 'letsencrypt',
|
||||
// 'server_conditions' => [
|
||||
// 'relation' => 'AND',
|
||||
// [
|
||||
// 'rsssl_do_local_lets_encrypt_generation' => true,
|
||||
// ]
|
||||
// ],
|
||||
'actions' => [
|
||||
[
|
||||
'description' => __("Checking if Terms & Conditions are accepted...", "really-simple-ssl"),
|
||||
'action'=> 'terms_accepted',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __("Creating account...", "really-simple-ssl"),
|
||||
'action'=> 'get_account',
|
||||
'attempts' => 5,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
[
|
||||
'description' => __("Generating SSL certificate...", "really-simple-ssl"),
|
||||
'action'=> 'create_bundle_or_renew',
|
||||
'attempts' => 5,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'installation',
|
||||
'menu_id' => 'le-installation',
|
||||
'group_id' => 'le-installation',
|
||||
'type' => 'letsencrypt',
|
||||
'actions' => [
|
||||
[
|
||||
'description' => __("Searching for link to SSL installation page on your server...", "really-simple-ssl"),
|
||||
'action'=> 'search_ssl_installation_url',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => 'activate_ssl',
|
||||
'menu_id' => 'le-activate_ssl',
|
||||
'group_id' => 'le-activate_ssl',
|
||||
'type' => 'activate',
|
||||
],
|
||||
]);
|
||||
|
||||
if ( is_multisite() ) {
|
||||
$index = array_search( 'system-status', array_column( $fields, 'id' ) );
|
||||
$new_test = [
|
||||
'description' => __( "Checking for subdomain setup...", "really-simple-ssl" ),
|
||||
'action' => 'is_subdomain_setup',
|
||||
'attempts' => 1,
|
||||
'status' => 'inactive',
|
||||
];
|
||||
$current_tests = $fields[ $index ]['actions'];
|
||||
$current_tests[] = $new_test;
|
||||
$fields[ $index ]['actions'] = $current_tests;
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<?php // You don't belong here. ?>
|
||||
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
/**
|
||||
* Show notice if certificate needs to be renewed.
|
||||
*
|
||||
* @param array $notices
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function rsssl_le_get_notices_list($notices) {
|
||||
//these notices are also loaded if Lets Encrypt is not loaded. To prevent errors, notices which require LE functionality are not loaded
|
||||
if ( rsssl_generated_by_rsssl() && rsssl_letsencrypt_generation_allowed() ) {
|
||||
//expiration date requests are cached.
|
||||
$valid = RSSSL()->certificate->is_valid();
|
||||
$certinfo = get_transient( 'rsssl_certinfo' );
|
||||
$end_date = isset( $certinfo['validTo_time_t'] ) ? $certinfo['validTo_time_t'] : false;
|
||||
//if the certificate expires within the grace period, allow renewal
|
||||
//e.g. expiry date 30 may, now = 10 may => grace period 9 june.
|
||||
$expiry_date = ! empty( $end_date ) ? date( get_option( 'date_format' ), $end_date ) : false;
|
||||
|
||||
if ( get_option( 'rsssl_create_folders_in_root' ) ) {
|
||||
if ( ! get_option( 'rsssl_htaccess_file_set_key' ) || ! get_option( 'rsssl_htaccess_file_set_certs' ) || ! get_option( 'rsssl_htaccess_file_set_ssl' ) ) {
|
||||
$notices['root_files_not_protected'] = array(
|
||||
'condition' => array( 'rsssl_ssl_enabled' ),
|
||||
'callback' => '_true_',
|
||||
'score' => 10,
|
||||
'output' => array(
|
||||
'true' => array(
|
||||
'msg' => __( "Your Key and Certificate directories are not properly protected.", "really-simple-ssl" ),
|
||||
'url' => rsssl_link( "protect-ssl-generation-directories"),
|
||||
'icon' => 'warning',
|
||||
'plusone' => true,
|
||||
'dismissible' => true,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( rsssl_letsencrypt_generation_allowed() ) {
|
||||
if ( strpos(site_url(), 'www.') !== false ) {
|
||||
$text = __( "The non-www version of your site does not point to this website. This is recommended, as it will allow you to add it to the certificate as well.", 'really-simple-ssl' );
|
||||
} else {
|
||||
$text = __( "The www version of your site does not point to this website. This is recommended, as it will allow you to add it to the certificate as well.", 'really-simple-ssl' );
|
||||
}
|
||||
$notices['alias_domain_notice'] = array(
|
||||
'condition' => array( 'NOT rsssl_is_subdomain' ),
|
||||
'callback' => 'RSSSL_LE()->letsencrypt_handler->alias_domain_available',
|
||||
'score' => 10,
|
||||
'output' => array(
|
||||
'false' => array(
|
||||
'title' => __( "Domain", 'really-simple-ssl' ),
|
||||
'msg' => $text,
|
||||
'icon' => 'open',
|
||||
'plusone' => true,
|
||||
'dismissible' => true,
|
||||
),
|
||||
),
|
||||
'show_with_options' => [
|
||||
'domain',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if ( $expiry_date ) {
|
||||
$notices['ssl_detected'] = array(
|
||||
'condition' => array( 'rsssl_ssl_enabled' ),
|
||||
'callback' => 'RSSSL()->certificate->about_to_expire',
|
||||
'score' => 10,
|
||||
'output' => array(
|
||||
'false' => array(
|
||||
'msg' => sprintf( __( "Your certificate is valid until: %s", "really-simple-ssl" ), $expiry_date ),
|
||||
'icon' => 'success'
|
||||
),
|
||||
'true' => array(
|
||||
'msg' => sprintf( __( "Your certificate will expire on %s. You can renew it %shere%s.", "really-simple-ssl" ), $expiry_date, '<a href="' . rsssl_letsencrypt_wizard_url() . '">', '</a>' ),
|
||||
'icon' => 'open',
|
||||
'plusone' => true,
|
||||
'dismissible' => false,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$notices['certificate_installation'] = array(
|
||||
'condition' => array( 'rsssl_ssl_enabled', 'RSSSL()->certificate->about_to_expire' ),
|
||||
'callback' => 'RSSSL_LE()->letsencrypt_handler->certificate_renewal_status_notice',
|
||||
'score' => 10,
|
||||
'output' => array(
|
||||
'automatic-installation-failed' => array(
|
||||
'msg' => sprintf( __( "The automatic installation of your certificate has failed. Please check your credentials, and retry the %sinstallation%s.",
|
||||
"really-simple-ssl" ), '<a href="' . rsssl_letsencrypt_wizard_url() . '">', '</a>' ),
|
||||
'icon' => 'open',
|
||||
'plusone' => true,
|
||||
'dismissible' => false,
|
||||
),
|
||||
'manual-installation' => array(
|
||||
'msg' => sprintf( __( "The SSL certificate has been renewed, and requires manual %sinstallation%s in your hosting dashboard.", "really-simple-ssl" ),
|
||||
'<a href="' . rsssl_letsencrypt_wizard_url('le-installation') . '">', '</a>' ),
|
||||
'icon' => 'open',
|
||||
'plusone' => true,
|
||||
'dismissible' => false,
|
||||
),
|
||||
'manual-generation' => array(
|
||||
'msg' => sprintf( __( "Automatic renewal of your certificate was not possible. The SSL certificate should be %srenewed%s manually.", "really-simple-ssl" ),
|
||||
'<a href="' . rsssl_letsencrypt_wizard_url() . '">', '</a>' ),
|
||||
'icon' => 'open',
|
||||
'plusone' => true,
|
||||
'dismissible' => false,
|
||||
),
|
||||
'automatic' => array(
|
||||
'msg' => __( "Your certificate will be renewed and installed automatically.", "really-simple-ssl" ),
|
||||
'icon' => 'open',
|
||||
'plusone' => true,
|
||||
'dismissible' => false,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
//we run these notices only if the cert is generated by rsssl, or it's not valid.
|
||||
if ( rsssl_generated_by_rsssl() || !RSSSL()->certificate->is_valid() ) {
|
||||
$notices['can_use_shell'] = array(
|
||||
'condition' => array('rsssl_can_install_shell_addon'),
|
||||
'callback' => '_true_',
|
||||
'score' => 10,
|
||||
'output' => array(
|
||||
'true' => array(
|
||||
'msg' => __( "Your server provides shell functionality, which offers additional methods to install SSL. If installing SSL using the default methods is not possible, you can install the shell add on.", "really-simple-ssl" ),
|
||||
'icon' => 'open',
|
||||
'url' => "installing-ssl-using-shell-functions",
|
||||
'plusone' => true,
|
||||
'dismissible' => true,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
//show notice if the shell exec add on is not up to date
|
||||
if ( function_exists('rsssl_le_load_shell_addon') && defined('rsssl_shell_version') && version_compare(rsssl_shell_version,'2.0.0','<')){
|
||||
$notices['old_shell_exec_plugin'] = array(
|
||||
'callback' => '_true_',
|
||||
'score' => 10,
|
||||
'output' => array(
|
||||
'true' => array(
|
||||
'msg' => __( "You are using the Really Simple Security Shell Exec add on, but your current version needs to be updated.", "really-simple-ssl" ),
|
||||
'icon' => 'warning',
|
||||
'url' => "installing-ssl-using-shell-functions",
|
||||
'plusone' => true,
|
||||
'dismissible' => false,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
return $notices;
|
||||
}
|
||||
add_filter( 'rsssl_notices', 'rsssl_le_get_notices_list', 30, 1 );
|
||||
|
||||
/**
|
||||
* Replace the go pro or scan button with a renew SSL button when the cert should be renewed.
|
||||
*/
|
||||
function rsssl_le_progress_footer_renew_ssl($button){
|
||||
if ( rsssl_ssl_enabled() && RSSSL()->certificate->about_to_expire() ){
|
||||
$status = RSSSL_LE()->letsencrypt_handler->certificate_renewal_status_notice;
|
||||
switch ($status){
|
||||
case 'manual-installation':
|
||||
$button_text = __("Renew installation", "really-simple-ssl");
|
||||
break;
|
||||
case 'manual-generation':
|
||||
$button_text = __("Renew certificate", "really-simple-ssl");
|
||||
break;
|
||||
default:
|
||||
$button_text = __("Renew certificate", "really-simple-ssl");//false;
|
||||
}
|
||||
if ($button_text) {
|
||||
$url = rsssl_letsencrypt_wizard_url();
|
||||
$button = '<a href="'.$url.'" class="button button-default">'.$button_text.'</a>';
|
||||
}
|
||||
}
|
||||
return $button;
|
||||
}
|
||||
add_filter("rsssl_progress_footer_right", "rsssl_le_progress_footer_renew_ssl", 30);
|
||||
Reference in New Issue
Block a user