Файловый менеджер - Редактировать - /home/infrafs/INFRABIKEIT/wp-content/plugins/lets-encrypt.tar
Назад
wizard/config/questions.php 0000644 00000030334 15133001561 0012052 0 ustar 00 <?php defined( 'ABSPATH' ) or die( ); /* * condition: if a question should be dynamically shown or hidden, depending on another answer. Use NOT answer to hide if not answer. * callback_condition: if should be shown or hidden based on an answer in another screen. * callback roept action rsssl_$page_$callback aan * required: verplicht veld. * help: helptext die achter het veld getoond wordt. "fieldname" => '', "type" => 'text', "required" => false, 'default' => '', 'label' => '', 'table' => false, 'callback_condition' => false, 'condition' => false, 'callback' => false, 'placeholder' => '', 'optional' => false, * */ $this->fields = $this->fields + array( 'system_status' => array( 'step' => 1, 'section' => 1, 'source' => 'lets-encrypt', 'callback' => 'system-status.php', ), 'email_address' => array( 'step' => 2, 'section' => 1, 'source' => 'lets-encrypt', 'type' => 'email', 'default' => get_option('admin_email'), 'tooltip' => __( "This email address will used to create a Let's Encrypt account. This is also where you will receive renewal notifications.", 'really-simple-ssl' ), 'tooltip-position' => 'title', 'label' => __( "Email address", 'really-simple-ssl' ), 'sublabel' => __("This field is prefilled based on your configuration", 'really-simple-ssl'), 'required' => true, ), 'accept_le_terms' => array( 'step' => 2, 'section' => 1, 'source' => 'lets-encrypt', 'type' => 'checkbox', 'default' => '', 'required' => true, 'title' => __('Terms & Conditions',"really-simple-ssl"), 'option_text' => sprintf(__("I agree to the Let's Encrypt %sTerms & Conditions%s", 'really-simple-ssl'),'<a target="_blank" href="https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf">','</a>'), ), 'disable_ocsp' => array( 'step' => 2, 'section' => 1, 'source' => 'lets-encrypt', 'type' => 'checkbox', 'default' => '', 'help' => __( "OCSP stapling should be enabled by default. You can disable if this is not supported by your hosting provider.","really-simple-ssl").rsssl_read_more('https://really-simple-ssl.com/ocsp-stapling'), 'title' => __('OCSP Stapling',"really-simple-ssl"), 'option_text' => __("Disable OCSP Stapling", 'really-simple-ssl'), ), 'domain' => array( 'step' => 2, 'section' => 1, 'source' => 'lets-encrypt', 'type' => 'text', 'default' => rsssl_get_domain(), 'label' => __( "Domain", 'really-simple-ssl' ), 'sublabel' => __("This field is prefilled based on your configuration", 'really-simple-ssl'), 'required' => false, 'disabled' => true, ), 'include_alias' => array( 'step' => 2, 'section' => 1, 'source' => 'lets-encrypt', 'type' => 'checkbox', 'default' => '', 'tooltip' => __( "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' ), 'tooltip-position' => 'after', 'option_text' => __("Include alias domain too?", 'really-simple-ssl'), 'callback_condition' => array( 'NOT rsssl_is_subdomain', 'NOT rsssl_wildcard_certificate_required', ) ), 'other_host_type' => array( 'step' => 2, 'section' => 1, 'source' => 'lets-encrypt', 'type' => 'select', 'tooltip' => __( "By selecting your hosting provider we can tell you if your hosting provider already supports free SSL, and how you can activate it.", "really-simple-ssl"), 'options' => $this->supported_hosts, 'help' => __( "By selecting your hosting provider we can tell you if your hosting provider already supports free SSL, and/or where you can activate it.","really-simple-ssl")." ". sprintf(__("If your hosting provider is not listed, and there's an SSL activation/installation link, please let us %sknow%s.","really-simple-ssl"),'<a target="_blank" href="https://really-simple-ssl.com/install-ssl-certificate/#hostingdetails">','</a>'), 'default' => false, 'label' => __( "Hosting provider", 'really-simple-ssl' ), 'required' => true, 'disabled' => false, ), 'cpanel_host' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'text', 'default' => '', 'label' => __( "CPanel host", 'really-simple-ssl' ), 'help' => __( "The URL you use to access your cPanel dashboard. Ends on :2083.", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_is_cpanel', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'cpanel_username' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'text', 'default' => '', 'label' => __( "CPanel username", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_cpanel_api_supported', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'cpanel_password' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'password', 'default' => '', 'label' => __( "CPanel password", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_cpanel_api_supported', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'directadmin_host' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'text', 'default' => '', 'label' => __( "DirectAdmin host", 'really-simple-ssl' ), 'help' => __( "The URL you use to access your DirectAdmin dashboard. Ends on :2222.", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_is_directadmin', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'directadmin_username' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'text', 'default' => '', 'label' => __( "DirectAdmin username", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_is_directadmin', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'directadmin_password' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'password', 'default' => '', 'label' => __( "DirectAdmin password", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_is_directadmin', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'cloudways_user_email' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'text', 'default' => '', 'placeholder' => 'email@email.com', 'label' => __( "CloudWays user email", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'other_host_type' => 'cloudways' ), ), 'cloudways_api_key' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'password', 'default' => '', 'label' => __( "CloudWays api key", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'comment' => 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>'), 'callback_condition' => array( 'other_host_type' => 'cloudways' ) ), 'plesk_host' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'text', 'default' => '', 'label' => __( "Plesk host", 'really-simple-ssl' ), 'help' => __( "The URL you use to access your Plesk dashboard. Ends on :8443.", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_is_plesk', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'plesk_username' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'text', 'default' => '', 'label' => __( "Plesk username", 'really-simple-ssl' ), 'help' => 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, 'callback_condition' => array( 'rsssl_is_plesk', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'plesk_password' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'password', 'default' => '', 'label' => __( "Plesk password", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_is_plesk', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ) ), 'store_credentials' => array( 'step' => 2, 'section' => 2, 'source' => 'lets-encrypt', 'type' => 'checkbox', 'default' => '', 'title' => __( "Credentials storage", 'really-simple-ssl' ), 'option_text' => __( "Store for renewal purposes. If not stored, renewal may need to be done manually.", 'really-simple-ssl' ), 'required' => false, 'disabled' => false, 'callback_condition' => array( 'rsssl_uses_known_dashboard', 'NOT rsssl_activated_by_default', 'NOT rsssl_activation_required', 'NOT rsssl_paid_only', ), ), 'directories' => array( 'step' => 3, 'section' => 1, 'source' => 'lets-encrypt', 'callback' => 'directories.php', 'callback_condition' => 'rsssl_do_local_lets_encrypt_generation' ), 'dns-verification' => array( 'step' => 4, 'section' => 1, 'source' => 'lets-encrypt', 'callback' => 'dns-verification.php', 'callback_condition' => 'rsssl_dns_verification_required' ), 'generation' => array( 'step' => 5, 'section' => 1, 'source' => 'lets-encrypt', 'callback' => 'generation.php', 'callback_condition' => 'rsssl_do_local_lets_encrypt_generation' ), 'installation' => array( 'step' => 6, 'section' => 1, 'source' => 'lets-encrypt', 'callback' => 'installation.php', ), 'activate_ssl' => array( 'step' => 7, 'source' => 'lets-encrypt', 'callback' => 'activate.php', ), ); wizard/config/class-config.php 0000644 00000066232 15133001561 0012376 0 ustar 00 <?php defined( 'ABSPATH' ) or die( ); if ( ! class_exists( "rsssl_config" ) ) { class rsssl_config { private static $_this; public $fields = array(); public $sections; public $pages; public $steps; public $hosts; public $warning_types; public $yes_no; public $supported_hosts; public $not_local_certificate_hosts; public $no_installation_renewal_needed; public $dashboard_activation_required; public $activated_by_default; public $paid_only; function __construct() { define('RSSSL_LE_CONFIG_LOADED', true); if ( isset( self::$_this ) ) { wp_die( sprintf( '%s is a singleton class and you cannot create a second instance.', get_class( $this ) ) ); } 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, '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, '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, ), '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, ), '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', ), ); $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'; $this->yes_no = array( 'yes' => __( 'Yes', 'really-simple-ssl' ), 'no' => __( 'No', 'really-simple-ssl' ), ); 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'); /* config files Load only on lets encrypt generation pages, or during cron. */ if ( rsssl_letsencrypt_generation_allowed(true) ) { require_once( rsssl_le_path . 'wizard/config/steps.php' ); require_once( rsssl_le_path . 'wizard/config/questions.php' ); /** * Preload fields with a filter, to allow for overriding types */ add_action( 'plugins_loaded', array( $this, 'preload_init' ), 10 ); /** * The integrations are loaded with priority 10 * Because we want to initialize after that, we use 15 here */ add_action( 'plugins_loaded', array( $this, 'init' ), 15 ); } } static function this() { return self::$_this; } /** * @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()->config->filter_hosts( 'api', $type); if ( in_array($hosting_company, $hosts_has_dashboard) ) { return true; } else { return false; } } public function fields( $page = false, $step = false, $section = false, $get_by_fieldname = false ) { $output = array(); $fields = $this->fields; if ( $page ) { $fields = rsssl_array_filter_multidimensional( $this->fields, 'source', $page ); } foreach ( $fields as $fieldname => $field ) { if ( $get_by_fieldname && $fieldname !== $get_by_fieldname ) { continue; } if ( $step ) { if ( $section && isset( $field['section'] ) ) { if ( ( $field['step'] == $step || ( is_array( $field['step'] ) && in_array( $step, $field['step'] ) ) ) && ( $field['section'] == $section ) ) { $output[ $fieldname ] = $field; } } else { if ( ( $field['step'] == $step ) || ( is_array( $field['step'] ) && in_array( $step, $field['step'] ) ) ) { $output[ $fieldname ] = $field; } } } if ( ! $step ) { $output[ $fieldname ] = $field; } } return $output; } public function has_sections( $page, $step ) { if ( isset( $this->steps[ $page ][ $step ]["sections"] ) ) { return true; } return false; } public function preload_init(){ $this->fields = apply_filters( 'rsssl_fields_load_types', $this->fields ); $this->steps = apply_filters( 'rsssl_steps', $this->steps ); } public function init() { $this->fields = apply_filters( 'rsssl_fields', $this->fields ); } } } //class closure wizard/config/steps.php 0000644 00000016407 15133001561 0011163 0 ustar 00 <?php defined( 'ABSPATH' ) or die( ); $this->steps = array( 'lets-encrypt' => array( 1 => array( "id" => "system-status", "title" => __( "System Status", 'really-simple-ssl' ), "intro" => __( "Detected status of your setup.", "really-simple-ssl" ), 'actions' => array( array( 'description' => __("Checking PHP version...", "really-simple-ssl"), 'action'=> 'rsssl_php_requirement_met', 'attempts' => 1, ), array( 'description' => __("Checking SSL certificate...", "really-simple-ssl"), 'action'=> 'certificate_status', 'attempts' => 1, ), array( 'description' => __("Checking if CURL is available...", "really-simple-ssl"), 'action'=> 'curl_exists', 'attempts' => 1, ), array( 'description' => __("Checking server software...", "really-simple-ssl"), 'action'=> 'server_software', 'attempts' => 1, ), array( 'description' => __("Checking alias domain...", "really-simple-ssl"), 'action'=> 'alias_domain_available', 'attempts' => 3, ), array( 'description' => __("Checking for website configuration...", "really-simple-ssl"), 'action'=> 'check_domain', 'attempts' => 1, ), ), ), 2 => array( "id" => "domain", "title" => __( "General settings", 'really-simple-ssl' ), 'intro' => '<p>'. sprintf(__('We have tried to make our Wizard as simple and fast as possible. Although these questions are all necessary, if there’s any way you think we can improve the plugin, please let us %sknow%s!', 'really-simple-ssl'),'<a target="_blank" href="https://really-simple-ssl.com/contact">', '</a>'). sprintf(__(' Please note that you can always save and finish the wizard later, use our %sdocumentation%s for additional information or log a %ssupport ticket%s if you need our assistance.', 'really-simple-ssl'),'<a target="_blank" href="https://really-simple-ssl.com/knowledge-base/generate-your-free-ssl-certificate/">', '</a>','<a target="_blank" href="https://wordpress.org/support/plugin/really-simple-ssl/">', '</a>').'</p>', 'sections' => array ( 1 => array( 'title' => __( 'Domain', 'really-simple-ssl' ), 'intro' => __( 'Letʼs Encrypt is a free, automated and open certificate authority brought to you by the nonprofit Internet Security Research Group (ISRG).', 'really-simple-ssl' ). rsssl_read_more( 'https://really-simple-ssl.com/about-lets-encrypt/' ), ), 2 => array( 'title' => __( 'Hosting', 'really-simple-ssl' ), 'intro' => __( 'Below you will find the instructions for different hosting environments and configurations. If you start the process with the necessary instructions and credentials the next view steps will be done in no time.', 'really-simple-ssl'), ), ), 'actions' => array(), ), 3 => array( "id" => "directories", "title" => __( "Directories", 'really-simple-ssl' ), 'actions' => array( array( 'description' => __("Checking host...", "really-simple-ssl"), 'action'=> 'check_host', 'attempts' => 1, 'speed' => 'normal', ), array( 'description' => __("Checking challenge directory...", "really-simple-ssl"), 'action'=> 'check_challenge_directory', 'attempts' => 1, 'speed' => 'normal', ), array( 'description' => __("Checking key directory...", "really-simple-ssl"), 'action'=> 'check_key_directory', 'attempts' => 2, 'speed' => 'normal', ), array( 'description' => __("Checking certs directory...", "really-simple-ssl"), 'action'=> 'check_certs_directory', 'attempts' => 1, 'speed' => 'normal', ), array( 'description' => __("Checking permissions...", "really-simple-ssl"), 'action'=> 'check_writing_permissions', 'attempts' => 1, 'speed' => 'normal', ), array( 'description' => __("Checking challenge directory reachable over http...", "really-simple-ssl"), 'action'=> 'challenge_directory_reachable', 'attempts' => 1, 'speed' => 'normal', ), ), ), 4 => array( "id" => "dns-verification", "title" => __( "DNS Verification", 'really-simple-ssl' ), 'actions' => array( array( 'description' => __("Creating account...", "really-simple-ssl"), 'action'=> 'get_account', 'attempts' => 5, 'speed' => 'normal', ), array( 'description' => __("Retrieving DNS verification token...", "really-simple-ssl"), 'action'=> 'get_dns_token', 'attempts' => 5, 'speed' => 'normal', ), ), ), 5 => array( "id" => "generation", "title" => __( "Generation", 'really-simple-ssl' ), "intro" => __( "We will now generate your SSL Certificate", "really-simple-ssl" ), 'actions' => array( array( 'description' => __("Checking if Terms & Conditions are accepted...", "really-simple-ssl"), 'action'=> 'terms_accepted', 'attempts' => 1, 'speed' => 'normal', ), array( 'description' => __("Creating account...", "really-simple-ssl"), 'action'=> 'get_account', 'attempts' => 5, 'speed' => 'normal', ), array( 'description' => __("Generating SSL certificate...", "really-simple-ssl"), 'action'=> 'create_bundle_or_renew', 'attempts' => 5, 'speed' => 'normal', ), ), ), 6 => array( "id" => "installation", "title" => __( "Installation", 'really-simple-ssl' ), 'actions' => array( array( 'description' => __("Searching for link to SSL installation page on your server...", "really-simple-ssl"), 'action'=> 'search_ssl_installation_url', 'attempts' => 1, 'speed' => 'normal', ), ), ), 7 => array( "id" => "activation", "title" => __( "Activate SSL", 'really-simple-ssl' ), 'actions' => array(), ), ), ); wizard/class-field.php 0000644 00000141244 15133001561 0010744 0 ustar 00 <?php defined( 'ABSPATH' ) or die(); if ( ! class_exists( "rsssl_field" ) ) { class rsssl_field { private static $_this; public $position; public $fields; public $default_args; public $form_errors = array(); function __construct() { if ( isset( self::$_this ) ) { wp_die( sprintf( '%s is a singleton class and you cannot create a second instance.', get_class( $this ) ) ); } self::$_this = $this; //safe before the fields are loaded in config, in init add_action( 'plugins_loaded', array( $this, 'process_save' ), 14 ); add_action( 'rsssl_before_label', array( $this, 'before_label' ), 10, 1 ); add_action( 'rsssl_label_html', array( $this, 'label_html' ), 10, 1 ); add_action( 'rsssl_after_label', array( $this, 'after_label' ), 10, 1 ); add_action( 'rsssl_after_field', array( $this, 'after_field' ), 10, 1 ); $this->load(); } static function this() { return self::$_this; } public function label_html( $args ) { ?> <label class="<?php if ( $args['disabled'] ) {echo 'rsssl-disabled';} ?>" for="<?php echo $args['fieldname'] ?>"> <div class="rsssl-label-wrap"><?php echo $args['label'] ?> <?php if ( isset($args['tooltip']) && $args['tooltip-position'] === 'title') { echo rsssl_icon('help', 'normal', $args['tooltip']); } ?> </div> <div class="rsssl-subtitle-wrap"><?php echo $args['sublabel'] ?></div> </label> <?php } public function load() { $this->default_args = array( "fieldname" => '', "type" => 'text', "required" => false, 'default' => '', 'label' => '', 'sublabel' => '', 'option_text' => false, 'table' => false, 'callback_condition' => false, 'condition' => false, 'callback' => false, 'placeholder' => '', 'optional' => false, 'disabled' => false, 'hidden' => false, 'region' => false, 'media' => true, 'first' => false, 'warn' => false, 'cols' => false, 'minimum' => 0, 'title' => '', 'tooltip-position' => '', ); } public function process_save() { if ( ! rsssl_user_can_manage() ) { return; } if ( isset( $_POST['rsssl_le_nonce'] ) ) { if ( ! isset( $_POST['rsssl_le_nonce'] ) || ! wp_verify_nonce( $_POST['rsssl_le_nonce'], 'rsssl_save' ) ) { return; } //save data $posted_fields = array_filter( $_POST, array( $this, 'filter_rsssl_fields' ), ARRAY_FILTER_USE_KEY ); foreach ( $posted_fields as $fieldname => $fieldvalue ) { $this->save_field( $fieldname, $fieldvalue ); } do_action('rsssl_after_saved_all_fields', $posted_fields ); } } /** * santize an array for save storage * * @param $array * * @return mixed */ public function sanitize_array( $array ) { foreach ( $array as &$value ) { if ( ! is_array( $value ) ) { $value = sanitize_text_field( $value ); } //if ($value === 'on') $value = true; else { $this->sanitize_array( $value ); } } return $array; } /** * Check if this is a conditional field * * @param $fieldname * * @return bool */ public function is_conditional( $fieldname ) { $fields = RSSSL_LE()->config->fields(); if ( isset( $fields[ $fieldname ]['condition'] ) && $fields[ $fieldname ]['condition'] ) { return true; } return false; } /** * Check if this is a multiple field * * @param $fieldname * * @return bool */ public function is_multiple_field( $fieldname ) { $fields = RSSSL_LE()->config->fields(); if ( isset( $fields[ $fieldname ]['type'] ) && ( $fields[ $fieldname ]['type'] == 'thirdparties' ) ) { return true; } if ( isset( $fields[ $fieldname ]['type'] ) && ( $fields[ $fieldname ]['type'] == 'processors' ) ) { return true; } return false; } public function save_multiple( $fieldnames ) { if ( ! rsssl_user_can_manage() ) { return; } $fields = RSSSL_LE()->config->fields(); foreach ( $fieldnames as $fieldname => $saved_fields ) { if ( ! isset( $fields[ $fieldname ] ) ) { return; } $page = $fields[ $fieldname ]['source']; $options = get_option( 'rsssl_options_' . $page ); $multiple_field = $this->get_value( $fieldname, array() ); foreach ( $saved_fields as $key => $value ) { $value = is_array( $value ) ? array_map( 'sanitize_text_field', $value ) : sanitize_text_field( $value ); //store the fact that this value was saved from the back-end, so should not get overwritten. $value['saved_by_user'] = true; $multiple_field[ $key ] = $value; } $options[ $fieldname ] = $multiple_field; if ( ! empty( $options ) ) { update_option( 'rsssl_options_' . $page, $options ); } } } /** * Save the field * @param string $fieldname * @param mixed $fieldvalue */ public function save_field( $fieldname, $fieldvalue ) { if ( ! rsssl_user_can_manage() ) { return; } $fieldvalue = apply_filters("rsssl_fieldvalue", $fieldvalue, $fieldname); $fields = RSSSL_LE()->config->fields(); $fieldname = str_replace( "rsssl_", '', $fieldname ); //do not save callback fields if ( isset( $fields[ $fieldname ]['callback'] ) ) { return; } $type = $fields[ $fieldname ]['type']; $page = $fields[ $fieldname ]['source']; $required = isset( $fields[ $fieldname ]['required'] ) ? $fields[ $fieldname ]['required'] : false; $fieldvalue = $this->sanitize( $fieldvalue, $type ); if ( ! $this->is_conditional( $fieldname ) && $required && empty( $fieldvalue ) ) { $this->form_errors[] = $fieldname; } if ($type === 'password' ) { $fieldvalue = RSSSL_LE()->letsencrypt_handler->encode($fieldvalue); } $options = get_option( 'rsssl_options_' . $page ); if ( ! is_array( $options ) ) { $options = array(); } $prev_value = isset( $options[ $fieldname ] ) ? $options[ $fieldname ] : false; do_action( "rsssl_before_save_" . $page . "_option", $fieldname, $fieldvalue, $prev_value, $type ); $options[ $fieldname ] = $fieldvalue; if ( ! empty( $options ) ) { update_option( 'rsssl_options_' . $page, $options ); } do_action( "rsssl_after_save_" . $page . "_option", $fieldname, $fieldvalue, $prev_value, $type ); } public function add_multiple_field( $fieldname, $cookie_type = false ) { if ( ! rsssl_user_can_manage() ) { return; } $fields = RSSSL_LE()->config->fields(); $page = $fields[ $fieldname ]['source']; $options = get_option( 'rsssl_options_' . $page ); $multiple_field = $this->get_value( $fieldname, array() ); if ( $fieldname === 'used_cookies' && ! $cookie_type ) { $cookie_type = 'custom_' . time(); } if ( ! is_array( $multiple_field ) ) { $multiple_field = array( $multiple_field ); } if ( $cookie_type ) { //prevent key from being added twice foreach ( $multiple_field as $index => $cookie ) { if ( $cookie['key'] === $cookie_type ) { return; } } //don't add field if it was deleted previously $deleted_cookies = get_option( 'rsssl_deleted_cookies' ); if ( ( $deleted_cookies && in_array( $cookie_type, $deleted_cookies ) ) ) { return; } //don't add default wordpress cookies if ( strpos( $cookie_type, 'wordpress_' ) !== false ) { return; } $multiple_field[] = array( 'key' => $cookie_type ); } else { $multiple_field[] = array(); } $options[ $fieldname ] = $multiple_field; if ( ! empty( $options ) ) { update_option( 'rsssl_options_' . $page, $options ); } } /** * Sanitize a field * @param $value * @param $type * * @return array|bool|int|string|void */ public function sanitize( $value, $type ) { if ( ! rsssl_user_can_manage() ) { return false; } switch ( $type ) { case 'colorpicker': return sanitize_hex_color( $value ); case 'text': return sanitize_text_field( $value ); case 'multicheckbox': if ( ! is_array( $value ) ) { $value = array( $value ); } return array_map( 'sanitize_text_field', $value ); case 'phone': $value = sanitize_text_field( $value ); return $value; case 'email': return sanitize_email( $value ); case 'url': return esc_url_raw( $value ); case 'number': return intval( $value ); case 'css': case 'javascript': return $value ; case 'editor': case 'textarea': case 'password': return wp_kses_post( $value ); } return sanitize_text_field( $value ); } /**/ private function filter_rsssl_fields( $fieldname ) { if ( strpos( $fieldname, 'rsssl_' ) !== false && isset( RSSSL_LE()->config->fields[ str_replace( 'rsssl_', '', $fieldname ) ] ) ) { return true; } return false; } public function before_label( $args ) { $condition_class = ''; $condition_question = ''; $condition_answer = ''; if ( ! empty( $args['condition'] ) ) { $condition_count = 1; foreach ( $args['condition'] as $question => $answer ) { $question = esc_attr( $question ); $answer = esc_attr( $answer ); $condition_class .= "condition-check-{$condition_count} "; $condition_question .= "data-condition-answer-{$condition_count}='{$answer}' "; $condition_answer .= "data-condition-question-{$condition_count}='{$question}' "; $condition_count++; } } $hidden_class = ( $args['hidden'] ) ? 'hidden' : ''; $rsssl_hidden = $this->condition_applies( $args ) ? '' : 'rsssl-hidden'; $first_class = ( $args['first'] ) ? 'first' : ''; $type = $args['type'] === 'notice' ? '' : $args['type']; $cols_class = isset($args['cols']) && $args['cols'] ? "rsssl-cols-{$args['cols']}" : ''; $col_class = isset($args['col']) ? "rsssl-col-{$args['col']}" : ''; $colspan_class = isset($args['colspan']) ? "rsssl-colspan-{$args['colspan']}" : ''; $this->get_master_label( $args ); echo '<div class="field-group ' . esc_attr( $args['fieldname'] . ' ' . esc_attr( $cols_class ) . ' ' . esc_attr( $col_class ) . ' ' . esc_attr( $colspan_class ) . ' ' . 'rsssl-'. $type . ' ' . $hidden_class . ' ' . $first_class . ' ' . $condition_class . ' ' . $rsssl_hidden ) . '" '; echo $condition_question; echo $condition_answer; // Close div! echo '>'; // Required to give a checkbox a title if ($args['title']) { $title = $args['title']; echo "<div class='rsssl-title-wrap rsssl-field'>$title</div>"; } echo '<div class="rsssl-field">'; if ($args['label']) { echo '<div class="rsssl-label">'; } } public function get_master_label( $args ) { if ( ! isset( $args['master_label'] ) ) { return; } ?> <div class="rsssl-master-label"><h2><?php echo esc_html( $args['master_label'] ) ?></h2></div> <?php } /** * Show tooltip, if provided * @param $args */ public function in_label($args) { if ( isset($args['tooltip']) ) { echo rsssl_icon('help', 'normal', $args['tooltip']); } } public function after_label( $args ) { if ($args['label'] ) { echo '</div>'; } } public function after_field( $args ) { $this->get_comment( $args ); echo '</div><!--close in after field-->'; echo '<div class="rsssl-help-warning-wrap">'; if ( isset( $args['help'] ) ) { rsssl_sidebar_notice( wp_kses_post( $args['help'] ) ); } do_action( 'rsssl_notice_' . $args['fieldname'], $args ); echo '</div>'; echo '</div>'; } public function text( $args ) { if ( ! $this->show_field( $args ) ) { return; } $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); $required = $args['required'] ? 'required' : ''; $is_required = $args['required'] ? 'is-required' : ''; $check_icon = rsssl_icon('check', 'success'); ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <input <?php echo $required ?> class="validation <?php echo $is_required ?>" placeholder="<?php echo esc_html( $args['placeholder'] ) ?>" type="text" value="<?php echo esc_html( $value ) ?>" name="<?php echo esc_html( $fieldname ) ?>" <?php if ( $args['disabled'] ) { echo 'disabled'; } ?> > <?php echo $check_icon ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function password( $args ) { if ( ! $this->show_field( $args ) ) { return; } $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); $required = $args['required'] ? 'required' : ''; $is_required = $args['required'] ? 'is-required' : ''; $check_icon = rsssl_icon('check', 'success'); ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <input <?php echo $required ?> class="validation <?php echo $is_required ?>" placeholder="<?php echo esc_html( $args['placeholder'] ) ?>" type="password" value="<?php echo esc_html( $value ) ?>" name="<?php echo esc_html( $fieldname ) ?>" <?php if ( $args['disabled'] ) { echo 'disabled'; } ?> > <?php echo $check_icon ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function url( $args ) { if ( ! $this->show_field( $args ) ) { return; } $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); $required = $args['required'] ? 'required' : ''; $is_required = $args['required'] ? 'is-required' : ''; $check_icon = rsssl_icon('check', 'success'); $times_icon = rsssl_icon('check', 'failed'); ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <input <?php echo $required ?> class="validation <?php echo $is_required ?>" placeholder="<?php echo esc_html( $args['placeholder'] ) ?>" type="text" pattern="(http(s)?(:\/\/))?(www.)?[#a-zA-Z0-9-_\.\/:].*" value="<?php echo esc_html( $value ) ?>" name="<?php echo esc_html( $fieldname ) ?>" > <?php echo $check_icon ?> <?php echo $times_icon ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function email( $args ) { if ( ! $this->show_field( $args ) ) { return; } $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); $required = $args['required'] ? 'required' : ''; $is_required = $args['required'] ? 'is-required' : ''; $check_icon = rsssl_icon('check', 'success'); $times_icon = rsssl_icon('check', 'failed'); ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <input <?php echo $required ?> class="validation <?php echo $is_required ?>" placeholder="<?php echo esc_html( $args['placeholder'] ) ?>" type="email" value="<?php echo esc_html( $value ) ?>" name="<?php echo esc_html( $fieldname ) ?>" > <?php echo $check_icon ?> <?php echo $times_icon ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function phone( $args ) { if ( ! $this->show_field( $args ) ) { return; } $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); $required = $args['required'] ? 'required' : ''; $is_required = $args['required'] ? 'is-required' : ''; $check_icon = rsssl_icon('check', 'success'); $times_icon = rsssl_icon('check', 'failed'); ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <input autocomplete="tel" <?php echo $required ?> class="validation <?php echo $is_required ?>" placeholder="<?php echo esc_html( $args['placeholder'] ) ?>" type="text" value="<?php echo esc_html( $value ) ?>" name="<?php echo esc_html( $fieldname ) ?>" > <?php echo $check_icon ?> <?php echo $times_icon ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function number( $args ) { $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <input <?php if ( $args['required'] ) { echo 'required'; } ?> class="validation <?php if ( $args['required'] ) { echo 'is-required'; } ?>" placeholder="<?php echo esc_html( $args['placeholder'] ) ?>" type="number" value="<?php echo esc_html( $value ) ?>" name="<?php echo esc_html( $fieldname ) ?>" min="<?php echo $args['minimum']?>" step="<?php echo isset($args["validation_step"]) ? intval($args["validation_step"]) : 1?>" > <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function checkbox( $args, $force_value = false ) { $fieldname = 'rsssl_' . $args['fieldname']; $value = $force_value ? $force_value : $this->get_value( $args['fieldname'], $args['default'] ); $placeholder_value = ( $args['disabled'] && $value ) ? $value : 0; if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <label class="rsssl-switch"> <input name="<?php echo esc_html( $fieldname ) ?>" type="hidden" value="<?php echo $placeholder_value ?>"/> <input name="<?php echo esc_html( $fieldname ) ?>" size="40" type="checkbox" <?php if ( $args['disabled'] ) { echo 'disabled'; } ?> <?php if ( $args['required'] ) { echo 'required'; } ?> class="<?php if ( $args['required'] ) { echo 'is-required'; } ?>" value="1" <?php checked( 1, $value, true ) ?> /> <span class="rsssl-slider rsssl-round"></span> </label> <?php if ($args['option_text'] ) { ?> <div class="rsssl-wizard-settings-text"><?php echo $args['option_text'] ?></div> <?php if (isset($args['tooltip']) && $args['tooltip-position'] === 'after') { echo rsssl_icon('help', 'normal', $args['tooltip']); } } do_action( 'rsssl_after_field', $args ); ?> <?php } public function radio( $args ) { if ( ! $this->show_field( $args ) ) { return; } $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); $options = $args['options']; $required = $args['required'] ? 'required' : ''; $check_icon = rsssl_icon('bullet', 'success'); $disabled_index = array(); $default_index = array(); if ( ! empty( $options ) ) { // Disabled index foreach ($options as $option_value => $option_label) { if ( is_array($args['disabled']) && in_array($option_value, $args['disabled']) || $args['disabled'] === true ) { $disabled_index[$option_value] = 'rsssl-disabled'; } else { $disabled_index[$option_value] = ''; } } // Default index foreach ($options as $option_value => $option_label) { if ( is_array($args['default']) && in_array($option_value, $args['default']) ) { $default_index[$option_value] = 'rsssl-default'; } else { $default_index[$option_value] = ''; } } } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <?php if ( ! empty( $options ) ) { foreach ( $options as $option_value => $option_label ) { if ($disabled_index[$option_value] === 'rsssl-disabled') { echo '<div class="rsssl-not-allowed">'; } ?> <label class="rsssl-radio-container <?php echo $disabled_index[$option_value] ?>"><?php echo esc_html( $option_label ) ?> <input <?php echo $required ?> type="radio" id="<?php echo esc_html( $option_value ) ?>" name="<?php echo esc_html( $fieldname ) ?>" class="<?php echo esc_html( $fieldname ) ?>" value="<?php echo esc_html( $option_value ) ?>" <?php if ( $value == $option_value ) echo "checked" ?> > <div class="radiobtn <?php echo $default_index[$option_value] ?>" <?php echo $required ?> ><?php echo $check_icon ?></div> </label> <?php if ($disabled_index[$option_value] === 'rsssl-disabled') { echo '</div>'; // class="rsssl-not-allowed" } } } ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function show_field( $args ) { $show = ( $this->condition_applies( $args, 'callback_condition' ) ); return $show; } public function function_callback_applies( $func ) { $invert = false; if ( strpos( $func, 'NOT ' ) !== false ) { $invert = true; $func = str_replace( 'NOT ', '', $func ); } $show_field = $func(); if ( $invert ) { $show_field = ! $show_field; } if ( $show_field ) { return true; } else { return false; } } /** * If multiple condition, uses AND relation * * @param $args * @param false $type * * @return bool */ public function condition_applies( $args, $type = false) { $default_args = $this->default_args; $args = wp_parse_args( $args, $default_args ); if ( ! $type ) { if ( $args['condition'] ) { $type = 'condition'; } elseif ( $args['callback_condition'] ) { $type = 'callback_condition'; } } if ( ! $type || ! $args[ $type ] ) { return true; } //function callbacks $maybe_is_function = is_string($args[ $type ]) ? str_replace( 'NOT ', '', $args[ $type ] ) : ''; if ( ! is_array( $args[ $type ] ) && ! empty( $args[ $type ] ) && function_exists( $maybe_is_function ) ) { return $this->function_callback_applies( $args[ $type ] ); } $condition = $args[ $type ]; //if we're checking the condition, but there's also a callback condition, check that one as well. //but only if it's an array. Otherwise it's a func. if ( $type === 'condition' && isset( $args['callback_condition'] ) && is_array( $args['callback_condition'] ) ) { $condition += $args['callback_condition']; } foreach ( $condition as $c_fieldname => $c_value_content ) { $c_values = $c_value_content; //the possible multiple values are separated with comma instead of an array, so we can add NOT. if ( ! is_array( $c_value_content ) && strpos( $c_value_content, ',' ) !== false ) { $c_values = explode( ',', $c_value_content ); } $c_values = is_array( $c_values ) ? $c_values : array( $c_values ); foreach ( $c_values as $c_value ) { $maybe_is_function = str_replace( 'NOT ', '', $c_value ); if ( function_exists( $maybe_is_function ) ) { $match = $this->function_callback_applies( $c_value ); if ( ! $match ) { return false; } } else { $actual_value = rsssl_get_value( $c_fieldname ); if ( strpos( $c_value, 'NOT ' ) === false ) { $invert = false; } else { $invert = true; $c_value = str_replace( "NOT ", "", $c_value ); } //when the actual value is an array, it is enough when just one matches. //to be able to return false, for no match at all, we check all items, then return false if none matched //this way we can preserve the AND property of this function $match = ( $c_value === $actual_value || in_array( $actual_value, $c_values ) ); if ( $invert ) { $match = ! $match; } if ( ! $match ) { return false; } } } } return true; } public function get_field_type( $fieldname ) { if ( ! isset( RSSSL_LE()->config->fields[ $fieldname ] ) ) { return false; } return RSSSL_LE()->config->fields[ $fieldname ]['type']; } public function textarea( $args ) { $fieldname = 'rsssl_' . $args['fieldname']; $check_icon = rsssl_icon('check', 'success'); $times_icon = rsssl_icon('check', 'failed'); $value = $this->get_value( $args['fieldname'], $args['default'] ); if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <textarea name="<?php echo esc_html( $fieldname ) ?>" <?php if ( $args['required'] ) { echo 'required'; } ?> class="validation <?php if ( $args['required'] ) { echo 'is-required'; } ?>" placeholder="<?php echo esc_html( $args['placeholder'] ) ?>"><?php echo esc_html( $value ) ?></textarea> <?php echo $check_icon ?> <?php echo $times_icon ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } /* * Show field with editor * * * */ public function editor( $args, $step = '' ) { $fieldname = 'rsssl_' . $args['fieldname']; $args['first'] = true; $media = $args['media'] ? true : false; $value = $this->get_value( $args['fieldname'], $args['default'] ); if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <?php $settings = array( 'media_buttons' => $media, 'editor_height' => 300, // In pixels, takes precedence and has no default value 'textarea_rows' => 15, ); wp_editor( $value, $fieldname, $settings ); ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function javascript( $args ) { $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <div id="<?php echo esc_html( $fieldname ) ?>editor" style="height: 200px; width: 100%"><?php echo $value ?></div> <?php do_action( 'rsssl_after_field', $args ); ?> <script> var <?php echo esc_html( $fieldname )?> = ace.edit("<?php echo esc_html( $fieldname )?>editor"); <?php echo esc_html( $fieldname )?>.setTheme("ace/theme/monokai"); <?php echo esc_html( $fieldname )?>.session.setMode("ace/mode/javascript"); jQuery(document).ready(function ($) { var textarea = $('textarea[name="<?php echo esc_html( $fieldname )?>"]'); <?php echo esc_html( $fieldname )?>. getSession().on("change", function () { textarea.val(<?php echo esc_html( $fieldname )?>.getSession().getValue() ) }); }); </script> <textarea style="display:none" name="<?php echo esc_html( $fieldname ) ?>"><?php echo $value ?></textarea> <?php } public function css( $args ) { $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <div id="<?php echo esc_html( $fieldname ) ?>editor" style="height: 290px; width: 100%"><?php echo $value ?></div> <?php do_action( 'rsssl_after_field', $args ); ?> <script> var <?php echo esc_html( $fieldname )?> = ace.edit("<?php echo esc_html( $fieldname )?>editor"); <?php echo esc_html( $fieldname )?>.setTheme("ace/theme/monokai"); <?php echo esc_html( $fieldname )?>.session.setMode("ace/mode/css"); jQuery(document).ready(function ($) { var textarea = $('textarea[name="<?php echo esc_html( $fieldname )?>"]'); <?php echo esc_html( $fieldname )?>. getSession().on("change", function () { textarea.val(<?php echo esc_html( $fieldname )?>.getSession().getValue() ) }); }); </script> <textarea style="display:none" name="<?php echo esc_html( $fieldname ) ?>"><?php echo $value ?></textarea> <?php } /** * Check if a step has any fields * @param string $page * @param bool $step * @param bool $section * * @return bool */ public function step_has_fields( $page, $step = false, $section = false ) { $fields = RSSSL_LE()->config->fields( $page, $step, $section ); foreach ( $fields as $fieldname => $args ) { $default_args = $this->default_args; $args = wp_parse_args( $args, $default_args ); $args['fieldname'] = $fieldname; if ( $this->show_field( $args ) ) { return true; } } return false; } public function get_fields( $source, $step = false, $section = false, $get_by_fieldname = false ) { $fields = RSSSL_LE()->config->fields( $source, $step, $section, $get_by_fieldname ); $i = 0; foreach ( $fields as $fieldname => $args ) { if ( $i === 0 ) { $args['first'] = true; } $i ++; $default_args = $this->default_args; $args = wp_parse_args( $args, $default_args ); $type = ( $args['callback'] ) ? 'callback' : $args['type']; $args['fieldname'] = $fieldname; switch ( $type ) { case 'callback': $this->callback( $args ); break; case 'text': $this->text( $args ); break; case 'password': $this->password( $args ); break; case 'button': $this->button( $args ); break; case 'upload': $this->upload( $args ); break; case 'url': $this->url( $args ); break; case 'select': $this->select( $args ); break; case 'checkbox': $this->checkbox( $args ); break; case 'textarea': $this->textarea( $args ); break; case 'radio': $this->radio( $args ); break; case 'javascript': $this->javascript( $args ); break; case 'css': $this->css( $args ); break; case 'email': $this->email( $args ); break; case 'phone': $this->phone( $args ); break; case 'number': $this->number( $args ); break; case 'notice': $this->notice( $args ); break; case 'editor': $this->editor( $args, $step ); break; case 'label': $this->label( $args ); break; } } } public function callback( $args ) { $callback = $args['callback']; do_action( 'rsssl_before_label', $args ); do_action( 'rsssl_label_html' , $args ); do_action( 'rsssl_after_label', $args ); $file = trailingslashit(rsssl_le_wizard_path) . 'templates/' . $callback; if ( file_exists($file) ) { echo RSSSL()->really_simple_ssl->get_template($callback, $path = rsssl_le_wizard_path); } else { do_action( "rsssl_$callback", $args ); } do_action( 'rsssl_after_field', $args ); } public function notice( $args ) { if ( ! $this->show_field( $args ) ) { return; } do_action( 'rsssl_before_label', $args ); rsssl_notice( $args['label'], 'warning' ); do_action( 'rsssl_after_label', $args ); do_action( 'rsssl_after_field', $args ); } public function select( $args ) { $fieldname = 'rsssl_' . $args['fieldname']; $value = $this->get_value( $args['fieldname'], $args['default'] ); if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <select class="rsssl-select2" <?php if ( $args['required'] ) { echo 'required'; } ?> name="<?php echo esc_html( $fieldname ) ?>"> <?php foreach ( $args['options'] as $option_key => $option_label ) { ?> <option value="<?php echo esc_html( $option_key ) ?>" <?php echo ( $option_key == $value ) ? "selected" : "" ?>><?php echo esc_html( $option_label ) ?></option> <?php } ?> </select> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function label( $args ) { $fieldname = 'rsssl_' . $args['fieldname']; if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } /** * * Button/Action field * * @param $args * * @echo string $html */ public function button( $args ) { $fieldname = 'rsssl_' . $args['fieldname']; if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <?php if ( $args['post_get'] === 'get' ) { ?> <a <?php if ( $args['disabled'] ) echo "disabled" ?>href="<?php echo $args['disabled'] ? "#" : rsssl_letsencrypt_wizard_url().'&action=' . $args['action'] ?>" class="button"><?php echo esc_html( $args['label'] ) ?></a> <?php } else { ?> <input <?php if ( $args['warn'] ) echo 'onclick="return confirm(\'' . $args['warn'] . '\');"' ?> <?php if ( $args['disabled'] ) echo "disabled" ?> class="button" type="submit" name="<?php echo $args['action'] ?>" value="<?php echo esc_html( $args['label'] ) ?>"> <?php } ?> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } /** * Upload field * * @param $args * * @echo string $html */ public function upload( $args ) { if ( ! $this->show_field( $args ) ) { return; } ?> <?php do_action( 'rsssl_before_label', $args ); ?> <?php do_action( 'rsssl_label_html' , $args );?> <?php do_action( 'rsssl_after_label', $args ); ?> <input type="file" type="submit" name="rsssl-upload-file" value="<?php echo esc_html( $args['label'] ) ?>"> <input <?php if ( $args['disabled'] ) echo "disabled" ?> class="button" type="submit" name="<?php echo $args['action'] ?>" value="<?php _e( 'Start', 'really-simple-ssl' ) ?>"> <?php do_action( 'rsssl_after_field', $args ); ?> <?php } public function save_button() { $button_text = __( "Save", 'really-simple-ssl' ); $button_name = 'rsssl-save'; $step = RSSSL_LE()->wizard->calculate_next('step'); $section = RSSSL_LE()->wizard->calculate_next('section'); $fields = RSSSL_LE()->config->fields( 'lets-encrypt', $step, $section); reset($fields); foreach ($fields as $key => $field ) { if (isset($field['callback']) && strpos($field['callback'], '.php')!==false) { $button_text = __( "Refresh", 'really-simple-ssl' ); $button_name = 'rsssl-refresh'; } } return '<input class="button button-secondary" type="submit" name="'.$button_name.'" value="'.$button_text.'">'; } /** * Get value of this fieldname * * @param $fieldname * @param string $default * * @return mixed */ public function get_value( $fieldname, $default = '' ) { $fields = RSSSL_LE()->config->fields(); if ( ! isset( $fields[ $fieldname ] ) ) { return false; } $source = $fields[ $fieldname ]['source']; $options = get_option( 'rsssl_options_' . $source ); $value = isset( $options[ $fieldname ] ) ? $options[ $fieldname ] : false; //if no value isset, pass a default $value = ( $value !== false ) ? $value : apply_filters( 'rsssl_default_value', $default, $fieldname ); return $value; } /** * Checks if a fieldname exists in the rsssl field list. * * @param string $fieldname * * @return bool */ public function sanitize_fieldname( $fieldname ) { $fields = RSSSL_LE()->config->fields(); if ( array_key_exists( $fieldname, $fields ) ) { return sanitize_text_field($fieldname); } return false; } public function get_comment( $args ) { if ( ! isset( $args['comment'] ) ) { return; } ?> <div class="rsssl-comment"><?php echo $args['comment'] ?></div> <?php } public function has_errors() { if ( count( $this->form_errors ) > 0 ) { return true; } return false; } } } //class closure wizard/templates/generation.php 0000644 00000001520 15133001561 0012677 0 ustar 00 <?php defined( 'ABSPATH' ) or die(); ?> <div class="rsssl-section"> <div class="rsssl-template-intro"> <p> </p> </div> <div class="rsssl-hidden rsssl-verify_dns rsssl-show-on-warning"> <p><?php _e("We could not check the DNS records. If you just added the record, please check in a few minutes.","really-simple-ssl")?> <?php printf(__("You can manually check the DNS records in an %sonline tool%s.","really-simple-ssl"),'<a target="_blank" href="https://mxtoolbox.com/SuperTool.aspx">','</a>')?> <?php _e("If you're sure it's set correctly, you can click the button to skip the DNS check.","really-simple-ssl")?> </p> <br> <input class="button button-default" type="submit" value="<?php _e("Skip DNS check",'really-simple-ssl')?>" name="rsssl-skip-dns-check"> </div> </div> wizard/templates/dns-verification.php 0000644 00000003312 15133001561 0014011 0 ustar 00 <?php defined( 'ABSPATH' ) or die( ); rsssl_progress_add('dns-verification'); ?> <div class="rsssl-section"> <div class="rsssl-hidden rsssl-get_dns_token rsssl-show-on-success"> <h2><?php _e("Next step", "really-simple-ssl"); ?></h2> <p><?php echo __("Add the following token as text record to your DNS records. We recommend to use a short TTL during installation, in case you need to change it.", "really-simple-ssl"). rsssl_read_more("https://really-simple-ssl.com/how-to-add-a-txt-record-to-dns/"); ?></p> <div id="rsssl-dns-text-records"></div> <script> jQuery(document).ready(function ($) { $(document).on("rsssl_le_response", rsssl_dns_data_handler); function rsssl_dns_data_handler(response) { if (response.detail.status==='success') { var tokens = JSON.parse(response.detail.output); for (var identifier in tokens) { if (tokens.hasOwnProperty(identifier)) { var token = tokens[identifier]; var inputField = '<div class="rsssl-dns-label" >@/<?php _e("domain","really-simple-ssl") ?></div><div class="rsssl-dns-field rsssl-selectable">_acme-challenge.'+identifier+'</div>'; inputField += '<div class="rsssl-dns-label" ><?php _e("Value","really-simple-ssl") ?></div><div class="rsssl-dns-field rsssl-selectable">'+token+'</div>'; $("#rsssl-dns-text-records").append(inputField); } } } } }); </script> </div> </div> wizard/templates/section.php 0000644 00000000161 15133001561 0012210 0 ustar 00 <div class="rsssl-section {active} {completed}"> {icon} <a href="{url}"> <h3>{title}</h3> </a> </div> wizard/templates/activate.php 0000644 00000007347 15133001561 0012361 0 ustar 00 <?php defined( 'ABSPATH' ) or die(); do_action('rsssl_le_activation'); //non cached SSL check. $response = RSSSL_LE()->letsencrypt_handler->certificate_status(); $certificate_is_valid = $response->status === 'error'; $already_enabled = RSSSL()->really_simple_ssl->ssl_enabled; $already_done = $certificate_is_valid && $already_enabled; if ($already_done) {?> <div class="rsssl-section"> <h2> <?php _e("Your site is secured with a valid SSL certificate!", "really-simple-ssl") . RSSSL()->rsssl_help->get_help_tip(__("In some cases it takes a few minutes for the certificate to get detected. In that case, check back in a few minutes.", "really-simple-ssl") ); ?> </h2> <?php _e("If you just activated SSL, please check for: ", 'really-simple-ssl'); ?> <p> <ul> <li class="rsssl-warning"><?php _e('Http references in your .css and .js files: change any http:// into https://', 'really-simple-ssl'); ?></li> <li class="rsssl-warning"><?php _e('Images, stylesheets or scripts from a domain without an SSL certificate: remove them or move to your own server.', 'really-simple-ssl'); ?></li> <li class="rsssl-success"><?php _e("SSL was already activated on your website!", "really-simple-ssl") ?></li> </ul> </p> <p><?php if (!defined('rsssl_pro_version')) { _e('You can also let the automatic scan of the pro version handle this for you, and get premium support, increased security with HSTS and more!', 'really-simple-ssl'); ?> <a target="_blank" href="<?php echo RSSSL()->really_simple_ssl->pro_url; ?>"><?php _e("Check out Really Simple SSL Pro", "really-simple-ssl"); } ?> </a> </p> </div> <?php } else { ?> <div class="rsssl-section"> <h2> <?php _e("Almost ready to activate SSL!", "really-simple-ssl") . RSSSL()->rsssl_help->get_help_tip(__("In some cases it takes a few minutes for the certificate to get detected. In that case, check back in a few minutes.", "really-simple-ssl") ); ?> </h2> <?php _e("Before you migrate, please check for: ", 'really-simple-ssl'); ?> <p> <ul> <li class="rsssl-warning"><?php _e('Http references in your .css and .js files: change any http:// into https://', 'really-simple-ssl'); ?></li> <li class="rsssl-warning"><?php _e('Images, stylesheets or scripts from a domain without an SSL certificate: remove them or move to your own server.', 'really-simple-ssl'); ?></li><?php $backup_link = "https://really-simple-ssl.com/knowledge-base/backing-up-your-site/"; $link_open = '<a target="_blank" href="'.$backup_link.'">'; $link_close = '</a>'; ?> <li class="rsssl-warning"><?php printf(__("We strongly recommend to create a %sbackup%s of your site before activating SSL", 'really-simple-ssl'), $link_open, $link_close); ?> </li> <li class="rsssl-warning"><?php _e("You may need to login in again.", "really-simple-ssl") ?></li> <?php if ($certificate_is_valid) { ?> <li class="rsssl-success"><?php _e("An SSL certificate has been detected", "really-simple-ssl") ?></li> <?php } else { ?> <li class="rsssl-error"><?php _e("No SSL certificate has been detected yet. In some cases this takes a few minutes.", "really-simple-ssl") ?></li> <?php }?> </ul> </p> <p><?php if (!defined('rsssl_pro_version')) { _e('You can also let the automatic scan of the pro version handle this for you, and get premium support, increased security with HSTS and more!', 'really-simple-ssl'); ?> <a target="_blank" href="<?php echo RSSSL()->really_simple_ssl->pro_url; ?>"><?php _e("Check out Really Simple SSL Pro", "really-simple-ssl"); } ?> </a> </p> </div> <?php } ?>