Yoast\WP\SEO\Abilities\Application
Llms_Txt_Status_Updater::get_generation_failure_warning
Returns the warning for a failed llms.txt generation, or null when the file was generated.
The reasons mirror the ones the file health check and the admin notification report.
Метод класса: Llms_Txt_Status_Updater{}
Хуков нет.
Возвращает
string|null. The warning.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_generation_failure_warning(): ?string;
Код Llms_Txt_Status_Updater::get_generation_failure_warning() Llms Txt Status Updater::get generation failure warning Yoast 28.8
private function get_generation_failure_warning(): ?string {
$this->file_runner->run();
if ( $this->file_runner->is_successful() ) {
return null;
}
switch ( $this->file_runner->get_generation_failure_reason() ) {
case 'not_managed_by_yoast_seo':
return \sprintf(
/* translators: %1$s expands to Yoast SEO */
\__( 'The llms.txt feature is enabled, but the file could not be generated or updated: an llms.txt file already exists that was not created by %1$s or has been edited manually, and it will not be overwritten. Delete it manually to let %1$s generate the file, or disable the %1$s feature.', 'wordpress-seo' ),
'Yoast SEO',
);
case 'filesystem_permissions':
return \__( 'The llms.txt feature is enabled, but the file could not be generated or updated: the web server\'s filesystem permissions do not allow writing it.', 'wordpress-seo' );
default:
return \__( 'The llms.txt feature is enabled, but the file could not be generated or updated, for unknown reasons.', 'wordpress-seo' );
}
}