admin_header( __( 'General Settings', 'wordpress-seo' ), true, 'yoast_wpseo_options', 'wpseo' ); // detect and handle robots meta here robots_meta_handler(); // detect and handle aioseo here aioseo_handler(); do_action( 'wpseo_all_admin_notices' ); echo $wpseo_admin_pages->hidden( 'ignore_blog_public_warning' ); echo $wpseo_admin_pages->hidden( 'ignore_tour' ); echo $wpseo_admin_pages->hidden( 'ignore_page_comments' ); echo $wpseo_admin_pages->hidden( 'ignore_permalink' ); echo $wpseo_admin_pages->hidden( 'ms_defaults_set' ); echo $wpseo_admin_pages->hidden( 'version' ); echo $wpseo_admin_pages->hidden( 'tracking_popup' ); if ( isset( $options['blocking_files'] ) && is_array( $options['blocking_files'] ) && count( $options['blocking_files'] ) > 0 ) { $options['blocking_files'] = array_unique( $options['blocking_files'] ); echo '
'
. '' . __( 'Fix it.', 'wordpress-seo' ) . ''
. __( '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 ) . '
';
}
echo __( 'Either delete them (this can be done with the "Fix it" button) or disable WP SEO XML sitemaps.', 'wordpress-seo' );
echo '
'
. '' . __( 'Fix it.', 'wordpress-seo' ) . ''
. __( 'Your theme contains a meta description, which blocks WordPress SEO from working properly, please delete the following line, or press fix it:', 'wordpress-seo' ) . '
';
echo '' . htmlentities( $options['theme_check']['description_found'] ) . '';
echo '
' . '' . __( 'Fix it.', 'wordpress-seo' ) . '' . '' . __( 'Ignore.', 'wordpress-seo' ) . '' . __( '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' ) && !isset( $options['ignore_page_comments'] ) ) echo '' . '' . __( 'Fix it.', 'wordpress-seo' ) . '' . '' . __( 'Ignore.', 'wordpress-seo' ) . '' . __( 'Paging comments is enabled, this is not needed in 999 out of 1000 cases, so the suggestion is to disable it, to do that, simply uncheck the box before "Break comments into pages..."', 'wordpress-seo' ) . '
'; echo '' . __( 'Take this tour to quickly learn about the use of this plugin.', 'wordpress-seo' ) . '
'; } echo '' . __( 'Reset Default Settings', 'wordpress-seo' ) . ''; echo '' . __( 'If you want to restore a site to the default WordPress SEO settings, press this button.', 'wordpress-seo' ) . '
'; echo '' . __( "To maintain a plugin as big as WordPress SEO, we need to know what we're dealing: what kinds of other plugins our users are using, what themes, etc. Please allow us to track that data from your install. It will not track any user details, so your security and privacy are safe with us.", 'wordpress-seo' ) . '
'; echo '' . __( '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' ) . '
'; echo '' . __( 'You can use the boxes below to verify with the different Webmaster Tools, if your site is already verified, you can just forget about these. Enter the verify meta values for:', 'wordpress-seo' ) . '
'; echo $wpseo_admin_pages->textinput( 'googleverify', '' . __( 'Google Webmaster Tools', 'wordpress-seo' ) . '' ); echo $wpseo_admin_pages->textinput( 'msverify', '' . __( 'Bing Webmaster Tools', 'wordpress-seo' ) . '' ); echo $wpseo_admin_pages->textinput( 'alexaverify', '' . __( 'Alexa Verification ID', 'wordpress-seo' ) . '' ); do_action( 'wpseo_dashboard' ); $wpseo_admin_pages->admin_footer(); /** * Handle deactivation & import of Robots Meta data * * @ since 1.4.8 */ function robots_meta_handler() { global $wpdb; // check if robots meta is running if ( is_plugin_active( 'robots-meta/robots-meta.php' ) ) { // deactivate robots meta if ( isset( $_GET['deactivate_robots_meta'] ) && $_GET['deactivate_robots_meta'] == 1 ) { deactivate_plugins( 'robots-meta/robots-meta.php' ); // show notice that robots meta has been deactivated add_action( 'wpseo_all_admin_notices', 'wpseo_deactivate_robots_meta_notice' ); // import the settings } else if ( isset( $_GET['import_robots_meta'] ) && $_GET['import_robots_meta'] == 1 ) { // import robots meta setting for each post $posts = $wpdb->get_results( "SELECT ID, robotsmeta FROM $wpdb->posts" ); foreach ( $posts as $post ) { // sync all possible settings if ( $post->robotsmeta ) { $pieces = explode( ',', $post->robotsmeta ); foreach ( $pieces as $meta ) { switch ( $meta ) { case 'noindex': wpseo_set_value( 'meta-robots-noindex', true, $post->ID ); break; case 'index': wpseo_set_value( 'meta-robots-noindex', 2, $post->ID ); break; case 'nofollow': wpseo_set_value( 'meta-robots-nofollow', true, $post->ID ); break; case 'follow': wpseo_set_value( 'meta-robots-nofollow', 0, $post->ID ); break; default: // do nothing } } } } // show notice to deactivate robots meta plugin add_action( 'wpseo_all_admin_notices', 'wpseo_deactivate_link_robots_meta_notice' ); // show notice to import robots meta settings } else { add_action( 'wpseo_all_admin_notices', 'wpseo_import_robots_meta_notice' ); } } } /** * Handle deactivation & import of AIOSEO data * * @ since 1.4.8 */ function aioseo_handler() { // check if aioseo is running if ( is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) ) { // deactivate aioseo plugin if ( isset( $_GET['deactivate_aioseo'] ) && $_GET['deactivate_aioseo'] == 1 ) { deactivate_plugins( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ); // show notice that aioseo has been deactivated add_action( 'wpseo_all_admin_notices', 'wpseo_deactivate_aioseo_notice' ); // import the settings // TODO: currently not deleting aioseop postmeta or handling old aioseop format } else if ( isset( $_GET['import_aioseo'] ) && $_GET['import_aioseo'] == 1 ) { $replace = false; replace_meta( '_aioseop_description', '_yoast_wpseo_metadesc', $replace ); replace_meta( '_aioseop_keywords', '_yoast_wpseo_metakeywords', $replace ); replace_meta( '_aioseop_title', '_yoast_wpseo_title', $replace ); if ( isset( $_POST['wpseo']['importaioseoold'] ) ) { replace_meta( 'description', '_yoast_wpseo_metadesc', $replace ); replace_meta( 'keywords', '_yoast_wpseo_metakeywords', $replace ); replace_meta( 'title', '_yoast_wpseo_title', $replace ); } // show notice to deactivate aioseo plugin add_action( 'wpseo_all_admin_notices', 'wpseo_deactivate_link_aioseo_notice' ); // show notice to import aioseo settings } else { add_action( 'wpseo_all_admin_notices', 'wpseo_import_aioseo_setting_notice' ); } } } /** * Throw a notice to import Robots Meta. * * @since 1.4.8 */ function wpseo_import_robots_meta_notice() { echo '' . sprintf( __( 'The plugin Robots-Meta has been detected. Do you want to %simport its settings%s.' ), '', '' ) . '
' . sprintf( __( 'Robots-Meta settings has been imported. We recommend %sdisabling the Robots-Meta plugin%s to avoid any conflicts' ), '', '' ) . '
' . __( 'Robots-Meta has been deactivated' ) . '
' . sprintf( __( 'The plugin All-In-One-SEO has been detected. Do you want to %simport its settings%s.' ), '', '' ) . '
' . sprintf( __( 'All in One SEO data successfully imported. Would you like to %sdisable the All in One SEO plugin%s.' ), '', '' ) . '
' . __( 'All-In-One-SEO has been deactivated' ) . '