' . esc_html( $backup_file ) . ', ', 'wordpress-seo' );
$count = 0;
$fcontent = str_replace( $options['theme_description_found'], '', $fcontent, $count );
if ( $count > 0 ) {
$header_file = fopen( $path . '/header.php', 'w+' );
if ( $header_file ) {
if ( fwrite( $header_file, $fcontent ) !== false ) {
$msg .= __( 'Removed hardcoded meta description.', 'wordpress-seo' );
$options['theme_has_description'] = false;
$options['theme_description_found'] = '';
update_option( 'wpseo', $options );
}
else {
$msg .= '' . __( 'Failed to remove hardcoded meta description.', 'wordpress-seo' ) . '';
}
fclose( $header_file );
}
}
else {
wpseo_description_test();
$msg .= '' . __( 'Earlier found meta description was not found in file. Renewed the description test data.', 'wordpress-seo' ) . '';
}
add_settings_error( 'yoast_wpseo_dashboard_options', 'error', $msg, 'updated' );
}
}
}
// Clean up the referrer url for later use.
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'nonce', 'fixmetadesc' ), $_SERVER['REQUEST_URI'] );
}
}
if ( ( ! isset( $options['theme_has_description'] ) || ( ( isset( $options['theme_has_description'] ) && $options['theme_has_description'] === true ) || $options['theme_description_found'] !== '' ) ) || ( isset( $_GET['checkmetadesc'] ) && check_admin_referer( 'wpseo-check-metadesc', 'nonce' ) ) ) {
wpseo_description_test();
// Renew the options after the test.
$options = get_option( 'wpseo' );
}
if ( isset( $_GET['checkmetadesc'] ) ) {
// Clean up the referrer url for later use.
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'nonce', 'checkmetadesc' ), $_SERVER['REQUEST_URI'] );
}
}
$yform = Yoast_Form::get_instance();
$yform->admin_header( true, 'wpseo' );
do_action( 'wpseo_all_admin_notices' );
if ( is_array( $options['blocking_files'] ) && count( $options['blocking_files'] ) > 0 ) {
echo '';
echo '', __( 'Fix it.', 'wordpress-seo' ), '';
echo __( 'The following file(s) is/are blocking your XML sitemaps from working properly:', 'wordpress-seo' ), '
';
foreach ( $options['blocking_files'] as $file ) {
echo esc_html( $file ), '
';
}
unset( $file );
/* translators: %1$s expands to Yoast SEO */
echo '
', sprintf( __( 'Either delete them (this can be done with the "Fix it" button) or disable %1$s XML sitemaps.', 'wordpress-seo' ), 'Yoast SEO' ), '
';
}
if ( $options['theme_description_found'] !== '' ) {
echo '';
echo '', __( 'Fix it.', 'wordpress-seo' ), '';
echo ' ', __( 'Re-check theme.', 'wordpress-seo' ), '';
/* translators: %1$s expands to Yoast SEO */
echo sprintf( __( 'Your theme contains a meta description, which blocks %1$s from working properly, please delete the following line, or press fix it:', 'wordpress-seo' ), 'Yoast SEO' ) . '
';
echo '', esc_html( $options['theme_description_found'] ), '';
echo '
';
}
if ( strpos( get_option( 'permalink_structure' ), '%postname%' ) === false && $options['ignore_permalink'] === false ) {
echo '';
echo '', __( 'Fix it.', 'wordpress-seo' ), '';
echo '', __( 'Ignore.', 'wordpress-seo' ), '';
echo __( 'You do not have your postname in the URL of your posts and pages, it is highly recommended that you do. Consider setting your permalink structure to /%postname%/.', 'wordpress-seo' ), '
';
}
if ( get_option( 'page_comments' ) && $options['ignore_page_comments'] === false ) {
echo '';
}
?>
textinput( 'website_name', __( 'Website name', 'wordpress-seo' ), array( 'placeholder' => get_bloginfo( 'name' ) ) );
$yform->textinput( 'alternate_website_name', __( 'Alternate name', 'wordpress-seo' ) );
?>
select( 'company_or_person', __( 'Company or person', 'wordpress-seo' ), array(
'' => __( 'Choose whether you\'re a company or person', 'wordpress-seo' ),
'company' => __( 'Company', 'wordpress-seo' ),
'person' => __( 'Person', 'wordpress-seo' ),
) );
?>
textinput( 'company_name', __( 'Company Name', 'wordpress-seo' ) );
$yform->media_input( 'company_logo', __( 'Company Logo', 'wordpress-seo' ) );
?>
textinput( 'person_name', __( 'Your name', 'wordpress-seo' ) ); ?>
', __( 'Unchecking this box allows authors and editors to redirect posts, noindex them and do other things you might not want if you don\'t trust your authors.', 'wordpress-seo' ), '';
/* translators: %1$s expands to Yoast SEO */
$yform->checkbox( 'disableadvanced_meta', sprintf( __( 'Disable the Advanced part of the %1$s meta box', 'wordpress-seo' ), 'Yoast SEO' ) );
?>
admin_footer();