*/
class ServerInfo_Robots_Details
{
public function __construct()
{
$this->init();
}
public function init()
{
?>
jltwp_adminify_robots_txt_file();
// Get the wp "robots.txt" file content
$file_content = $this->jltwp_adminify_robots_txt_file_content($file);
if ($file) { ?>
' . esc_html($file) . ''; ?>
exists($file)
) {
return $file;
}
// File not exist
return false;
}
function jltwp_adminify_robots_txt_file_content($file)
{
// Call wp file system
global $wp_filesystem;
WP_Filesystem();
// Show this notice, if no file exist
$content = esc_html__('robots.txt file not found!', WP_ADMINIFY_TD);
// Check if "robots.txt" file exist
if ($wp_filesystem->exists($file)) {
$content = $wp_filesystem->get_contents($file);
// Check if the file content is empty
if ($wp_filesystem->get_contents($file) == '') {
$content = esc_html__('File content is empty.', WP_ADMINIFY_TD);
}
}
return $content;
}
}