import {__} from '@wordpress/i18n'; import Hyperlink from "../utils/Hyperlink"; import { Button, } from '@wordpress/components'; import useFields from "../Settings/FieldsData"; import useMenu from "../Menu/MenuData"; import {useEffect} from '@wordpress/element'; import useLetsEncryptData from "./letsEncryptData"; import {addUrlRef} from "../utils/AddUrlRef"; const Directories = ({action, field}) => { const {switchButtonDisabled, updateVerificationType, setRefreshTests} = useLetsEncryptData(); const {addHelpNotice, updateField, setChangedField, saveFields, fetchFieldsData} = useFields(); const { setSelectedSubMenuItem} = useMenu(); useEffect(() => { if ((action && action.action === 'challenge_directory_reachable' && action.status === 'error')) { addHelpNotice( field.id, 'default', __("The challenge directory is used to verify the domain ownership.", "really-simple-ssl"), ); } if ((action && action.action === 'check_key_directory' && action.status === 'error')) { addHelpNotice( field.id, 'default', __("The key directory is needed to store the generated keys.", "really-simple-ssl") + ' ' + __("By placing it outside the root folder, it is not publicly accessible.", "really-simple-ssl"), ); } if ((action && action.action === 'check_certs_directory' && action.status === 'error')) { addHelpNotice( field.id, 'default', __("The certificate will get stored in this directory.", "really-simple-ssl") + ' ' + __("By placing it outside the root folder, it is not publicly accessible.", "really-simple-ssl"), ); } }, [action]); if ( !action ) { return (<>>); } const handleSwitchToDNS = async () => { updateField('verification_type', 'dns'); setChangedField('verification_type', 'dns'); await saveFields(true, true); await updateVerificationType('dns'); await setSelectedSubMenuItem('le-dns-verification'); await fetchFieldsData('le-dns-verification'); setRefreshTests(true); } let dirError = action.status === 'error' && action.action === 'challenge_directory_reachable'; return (
{__("If the challenge directory cannot be created, or is not reachable, you can either remove the server limitation, or change to DNS verification.", "really-simple-ssl")}
{__("Navigate in FTP or File Manager to the root of your WordPress installation:", "really-simple-ssl")}
{__("If the challenge directory cannot be created, you can either remove the server limitation, or change to DNS verification.", "really-simple-ssl")}
{__("Navigate in FTP or File Manager to one level above the root of your WordPress installation:", "really-simple-ssl")}
{__("Navigate in FTP or File Manager to one level above the root of your WordPress installation:", "really-simple-ssl")}