->core->fs;
if ( ! $fs->isWpfsValid() ) {
return false;
}
$accessType = get_filesystem_method();
if ( 'direct' === $accessType ) {
$file = trailingslashit( $fs->fs->abspath() ) . 'robots.txt';
return $fs->exists( $file );
}
return false;
}
/**
* Get the default Robots.txt lines (excluding our own).
*
* @since 4.1.7
* @version 4.4.2
*
* @return string The robots.txt content rules (excluding our own).
*/
public function getDefaultRobotsTxtContent() {
// First, we need to remove our filter, so that it doesn't run unintentionally.
remove_filter( 'robots_txt', [ $this, 'buildRules' ], 10000 );
ob_start();
do_robots();
if ( is_admin() ) {
header( 'Content-Type: text/html; charset=utf-8' );
}
$rules = strval( ob_get_clean() );
// Add the filter back.
add_filter( 'robots_txt', [ $this, 'buildRules' ], 10000 );
return $rules;
}
/**
* A check to see if the rewrite rules are set.
* This isn't perfect, but it will help us know in most cases.
*
* @since 4.0.0
*
* @return boolean Whether the rewrite rules are set or not.
*/
public function rewriteRulesExist() {
// If we have a physical file, it's almost impossible to tell if the rewrite rules are set.
// The only scenario is if we still get a 404.
$response = wp_remote_get( aioseo()->helpers->getSiteUrl() . '/robots.txt' );
if ( 299 < wp_remote_retrieve_response_code( $response ) ) {
return false;
}
return true;
}
}
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Common\Tools\RobotsTxt" not found in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php:300
Stack trace:
#0 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load()
#1 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init()
#2 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(414): AIOSEO\Plugin\AIOSEO::instance()
#3 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/all_in_one_seo_pack.php(96): aioseo()
#4 /home/valigeria/public_html/wp-settings.php(517): include_once('/home/valigeria...')
#5 /home/valigeria/public_html/wp-config.php(111): require_once('/home/valigeria...')
#6 /home/valigeria/public_html/wp-load.php(50): require_once('/home/valigeria...')
#7 /home/valigeria/public_html/wp-blog-header.php(13): require_once('/home/valigeria...')
#8 /home/valigeria/public_html/index.php(17): require('/home/valigeria...')
#9 {main}
thrown in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php on line 300