Yoast\WP\SEO\Llms_Txt\User_Interface\Health_Check
File_Reports::get_generation_failure_result
Returns the message for a failed health check. In this case, when the llms.txt file couldn't be auto-generated.
Метод класса: File_Reports{}
Хуков нет.
Возвращает
string[]. The message as a WordPress site status report.
Использование
$File_Reports = new File_Reports(); $File_Reports->get_generation_failure_result( $reason );
- $reason(строка) (обязательный)
- The reason why the llms.txt file couldn't be auto-generated.
Код File_Reports::get_generation_failure_result() File Reports::get generation failure result Yoast 28.6
public function get_generation_failure_result( $reason ) {
switch ( $reason ) {
case 'not_managed_by_yoast_seo':
$title = \__( 'Your llms.txt file couldn\'t be auto-generated', 'wordpress-seo' );
$message = \sprintf(
/* translators: 1,3,5: expand to opening paragraph tag, 2,4,6: expand to opening paragraph tag. */
\__( '%1$sYou have activated the Yoast llms.txt feature, but we couldn\'t generate an llms.txt file.%2$s%3$sIt looks like there is an llms.txt file already that wasn\'t created by Yoast, or the llms.txt file created by Yoast has been edited manually.%4$s%5$sWe don\'t want to overwrite this file\'s content, so if you want to let Yoast keep auto-generating the llms.txt file, you can manually delete the existing one. Otherwise, consider disabling the Yoast feature.%6$s', 'wordpress-seo' ),
'<p>',
'</p>',
'<p>',
'</p>',
'<p>',
'</p>',
);
break;
case 'filesystem_permissions':
$title = \__( 'Your llms.txt file couldn\'t be auto-generated', 'wordpress-seo' );
$message = \sprintf(
/* translators: 1,3: expand to opening paragraph tag, 2,4: expand to opening paragraph tag. */
\__( '%1$sYou have activated the Yoast llms.txt feature, but we couldn\'t generate an llms.txt file.%2$s%3$sIt looks like there aren\'t sufficient permissions on the web server\'s filesystem.%4$s', 'wordpress-seo' ),
'<p>',
'</p>',
'<p>',
'</p>',
);
break;
default:
$title = \__( 'Your llms.txt file couldn\'t be auto-generated', 'wordpress-seo' );
$message = \__( 'You have activated the Yoast llms.txt feature, but we couldn\'t generate an llms.txt file, for unknown reasons.', 'wordpress-seo' );
break;
}
return $this->get_report_builder()
->set_label( $title )
->set_status_recommended()
->set_description( $message )
->build();
}