/**
  * Load the introduction tour
  */
 function intro_tour()
 {
     global $pagenow, $current_user;
     $adminpages = array('wpseo_dashboard' => array('content' => '<h3>' . __('Dashboard', 'wordpress-seo') . '</h3><p>' . __('This is the WordPress SEO Dashboard, here you can restart this tour or revert the WP SEO settings to default.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('More WordPress SEO', 'wordpress-seo') . '</strong><br/>' . sprintf(__('There\'s more to learn about WordPress &amp; SEO than just using this plugin. Read our article %1$sthe definitive guide to WordPress SEO%2$s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/articles/wordpress-seo/#utm_source=wpadmin&utm_medium=wpseo_tour&utm_term=link&utm_campaign=wpseoplugin') . '">', '</a>') . '</p>' . '<p><strong>' . __('Webmaster Tools', 'wordpress-seo') . '</strong><br/>' . __('Underneath the General Settings, you can add the verification codes for the different Webmaster Tools programs, I highly encourage you to check out both Google and Bing\'s Webmaster Tools.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('About This Tour', 'wordpress-seo') . '</strong><br/>' . __('Clicking Next below takes you to the next page of the tour. If you want to stop this tour, click "Close".', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Like this plugin?', 'wordpress-seo') . '</strong><br/>' . sprintf(__('If you like this plugin, please %srate it 5 stars on WordPress.org%s and consider making a donation by clicking the button on the right!', 'wordpress-seo'), '<a target="_blank" href="https://wordpress.org/plugins/wordpress-seo/">', '</a>') . '</p>' . '<p><strong>' . __('Newsletter', 'wordpress-seo') . '</strong><br/>' . __('If you would like to keep up to date regarding the WordPress SEO plugin and other plugins by Yoast, subscribe to the newsletter:', 'wordpress-seo') . '</p>' . '<form action="http://yoast.us1.list-manage1.com/subscribe/post?u=ffa93edfe21752c921f860358&amp;id=972f1c9122" method="post" id="newsletter-form" accept-charset="' . esc_attr(get_bloginfo('charset')) . '">' . '<p>' . '<label for="newsletter-email">' . __('Email', 'wordpress-seo') . ':</label><input style="color:#666" name="EMAIL" value="' . esc_attr($current_user->user_email) . '" id="newsletter-email" placeholder="' . __('Email', 'wordpress-seo') . '"/><br/>' . '<input type="hidden" name="group" value="2"/>' . '<button type="submit" class="button-primary">' . __('Subscribe', 'wordpress-seo') . '</button>' . '</p></form>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_titles') . '";'), 'wpseo_titles' => array('content' => '<h3>' . __('Title &amp; Description settings', 'wordpress-seo') . '</h3>' . '<p>' . __('This is where you set the templates for your titles and descriptions of all the different types of pages on your blog, be it your homepage, posts &amp; pages (under post types), category or tag archives (under taxonomy archives), or even custom post type archives and custom posts: all of that is done from here.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Templates', 'wordpress-seo') . '</strong><br/>' . __('The templates are built using variables, the help tab for all the different variables available to you to use in these.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Sitewide settings', 'wordpress-seo') . '</strong><br/>' . __('You can also set some settings for the entire site here to add specific meta tags or to remove some unneeded cruft.', 'wordpress-seo') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_social') . '";'), 'wpseo_social' => array('content' => '<h3>' . __('Social settings', 'wordpress-seo') . '</h3>' . '<p><strong>' . __('Facebook Open Graph', 'wordpress-seo') . '</strong><br/>' . __('On this page you can enable the Open Graph functionality from this plugin, as well as assign a Facebook user or Application to be the admin of your site, so you can view the Facebook insights.', 'wordpress-seo') . '</p>' . '<p>' . sprintf(__('Read more about %1$sFacebook Open Graph%2$s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/facebook-open-graph-protocol/#utm_source=wpadmin&utm_medium=wpseo_tour&utm_term=link&utm_campaign=wpseoplugin') . '">', '</a>') . '</p>' . '<p><strong>' . __('Twitter Cards', 'wordpress-seo') . '</strong><br/>' . sprintf(__('This functionality is currently in beta, but it allows for %1$sTwitter Cards%2$s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/twitter-cards/#utm_source=wpadmin&utm_medium=wpseo_tour&utm_term=link&utm_campaign=wpseoplugin') . '">', '</a>') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_xml') . '";'), 'wpseo_xml' => array('content' => '<h3>' . __('XML Sitemaps', 'wordpress-seo') . '</h3><p>' . __('This plugin adds an XML sitemap to your site. It\'s automatically updated when you publish a new post, page or custom post and Google and Bing will be automatically notified.', 'wordpress-seo') . '</p><p>' . __('Be sure to check whether post types or taxonomies are showing that search engines shouldn\'t be indexing, if so, check the box before them to hide them from the XML sitemaps.', 'wordpress-seo') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_permalinks') . '";'), 'wpseo_permalinks' => array('content' => '<h3>' . __('Permalink Settings', 'wordpress-seo') . '</h3><p>' . __('All of the options here are for advanced users only, if you don\'t know whether you should check any, don\'t touch them.', 'wordpress-seo') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_internal-links') . '";'), 'wpseo_internal-links' => array('content' => '<h3>' . __('Breadcrumbs Settings', 'wordpress-seo') . '</h3><p>' . sprintf(__('If your theme supports my breadcrumbs, as all Genesis and WooThemes themes as well as a couple of other ones do, you can change the settings for those here. If you want to modify your theme to support them, %sfollow these instructions%s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/wordpress/plugins/breadcrumbs/#utm_source=wpadmin&utm_medium=wpseo_tour&utm_term=link&utm_campaign=wpseoplugin') . '">', '</a>') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_rss') . '";'), 'wpseo_rss' => array('content' => '<h3>' . __('RSS Settings', 'wordpress-seo') . '</h3><p>' . __('This incredibly powerful function allows you to add content to the beginning and end of your posts in your RSS feed. This helps you gain links from people who steal your content!', 'wordpress-seo') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_import') . '";'), 'wpseo_import' => array('content' => '<h3>' . __('Import &amp; Export', 'wordpress-seo') . '</h3><p>' . __('Just switched over from another SEO plugin? Use the options here to switch your data over. If you were using some of my older plugins like Robots Meta &amp; RSS Footer, you can import the settings here too.', 'wordpress-seo') . '</p><p>' . __('If you have multiple blogs and you\'re happy with how you\'ve configured this blog, you can export the settings and import them on another blog so you don\'t have to go through this process twice!', 'wordpress-seo') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . network_admin_url('admin.php?page=wpseo_files') . '";'), 'wpseo_files' => array('content' => '<h3>' . __('File Editor', 'wordpress-seo') . '</h3><p>' . __('Here you can edit the .htaccess and robots.txt files, two of the most powerful files in your WordPress install. Only touch these files if you know what you\'re doing!', 'wordpress-seo') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_bulk-title-editor') . '";'), 'wpseo_bulk-title-editor' => array('content' => '<h3>' . __('Bulk Title Editor', 'wordpress-seo') . '</h3><p>' . __('This is where you can view and edit the SEO titles of every post and page on your site. If you have a lot of pages that need SEO titles, use this page to save yourself the hassle of editing every page one at a time!', 'wordpress-seo') . '</p>', 'button2' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_bulk-description-editor') . '";'), 'wpseo_bulk-description-editor' => array('content' => '<h3>' . __('Bulk Description Editor', 'wordpress-seo') . '</h3><p>' . __('This page lets you view and edit the meta descriptions of all posts and pages on your site. Just like the Bulk Title Editor, this allows you to edit the meta description of all your pages in one place, rather than having to edit each individual page.', 'wordpress-seo') . '</p>' . '<p>' . sprintf(__('The tour ends here, thank you for using my plugin and good luck with your SEO!<br/><br/>Best,<br/>Joost de Valk - %1$sYoast.com%2$s', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/#utm_source=wpadmin&utm_medium=wpseo_tour&utm_term=link&utm_campaign=wpseoplugin') . '">', '</a>') . '</p>'));
     // Remove the last step and add tour end to import page if file editing is disallowed or if the site is a multisite and the current user isn't a superadmin
     if (wpseo_allow_system_file_edit() === false) {
         unset($adminpages['wpseo_files']);
         $adminpages['wpseo_import']['function'] = '';
         unset($adminpages['wpseo_import']['button2']);
         $adminpages['wpseo_import']['content'] .= '<p>' . sprintf(__('The tour ends here,thank you for using my plugin and good luck with your SEO!<br/><br/>Best,<br/>Joost de Valk - %1$sYoast.com%2$s', 'wordpress-seo'), '<a href="https://yoast.com/">', '</a>') . '</p>';
     }
     $page = '';
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
     }
     $function = '';
     $button2 = '';
     $opt_arr = array();
     $id = '#wpseo-title';
     if ('admin.php' != $pagenow || !array_key_exists($page, $adminpages)) {
         $id = 'li.toplevel_page_wpseo_dashboard';
         $content = '<h3>' . __('Congratulations!', 'wordpress-seo') . '</h3>';
         $content .= '<p>' . __('You\'ve just installed WordPress SEO by Yoast! Click "Start Tour" to view a quick introduction of this plugins core functionality.', 'wordpress-seo') . '</p>';
         $opt_arr = array('content' => $content, 'position' => array('edge' => 'top', 'align' => 'center'));
         $button2 = __('Start Tour', 'wordpress-seo');
         $function = 'document.location="' . admin_url('admin.php?page=wpseo_dashboard') . '";';
     } else {
         if ('' != $page && in_array($page, array_keys($adminpages))) {
             $align = is_rtl() ? 'right' : 'left';
             $opt_arr = array('content' => $adminpages[$page]['content'], 'position' => array('edge' => 'top', 'align' => $align), 'pointerWidth' => 400);
             if (isset($adminpages[$page]['button2'])) {
                 $button2 = $adminpages[$page]['button2'];
             }
             if (isset($adminpages[$page]['function'])) {
                 $function = $adminpages[$page]['function'];
             }
         }
     }
     $this->print_scripts($id, $opt_arr, __('Close', 'wordpress-seo'), $button2, $function);
 }
 /**
  * Load the introduction tour
  */
 function intro_tour()
 {
     global $pagenow, $current_user;
     // @FIXME: Links to tabs only work with target="_blank" and thus open in a new window
     $adminpages = array('wpseo_dashboard' => array('content' => '<h3>' . __('Dashboard', 'wordpress-seo') . '</h3><p>' . __('This is the WordPress SEO Dashboard, here you can restart this tour or revert the WP SEO settings to default.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('More WordPress SEO', 'wordpress-seo') . '</strong><br/>' . sprintf(__('There\'s more to learn about WordPress &amp; SEO than just using this plugin. A great start is our article %1$sthe definitive guide to WordPress SEO%2$s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/articles/wordpress-seo/#utm_source=wpseo_dashboard&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>' . '<p><strong>' . __('Tracking', 'wordpress-seo') . '</strong><br/>' . __('To provide you with the best experience possible, we need your help. Please enable tracking to help us gather anonymous usage data.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Webmaster Tools', 'wordpress-seo') . '</strong><br/>' . __('You can also add the verification codes for the different Webmaster Tools programs here, we highly encourage you to check out both Google and Bing\'s Webmaster Tools.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('WordPress SEO Tour', 'wordpress-seo') . '</strong><br/>' . __('This tour will show you around in the plugin, to give you a general overview of the plugin.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Newsletter', 'wordpress-seo') . '</strong><br/>' . __('If you would like to us to keep you up-to-date regarding WordPress SEO and other plugins by Yoast, subscribe to our newsletter:', 'wordpress-seo') . '</p>' . '<form action="http://yoast.us1.list-manage1.com/subscribe/post?u=ffa93edfe21752c921f860358&amp;id=972f1c9122" method="post" id="newsletter-form" accept-charset="' . esc_attr(get_bloginfo('charset')) . '">' . '<p>' . '<label for="newsletter-email">' . __('Email', 'wordpress-seo') . ':</label> <input style="margin: 5px; color:#666" name="EMAIL" value="' . esc_attr($current_user->user_email) . '" id="newsletter-email" placeholder="' . __('Email', 'wordpress-seo') . '"/><br/>' . '<input type="hidden" name="group" value="2"/>' . '<button type="submit" class="button-primary">' . __('Subscribe', 'wordpress-seo') . '</button>' . '</p></form>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_titles') . '";', 'position' => array('edge' => 'top', 'align' => 'center')), 'wpseo_titles' => array('content' => '<h3>' . __('Title &amp; Metas settings', 'wordpress-seo') . '</h3>' . '<p>' . __('This is where you set the titles and meta-information for all your post types, taxonomies, archives, special pages and for your homepage. The page is divided into different tabs., make sure you check \'m all out!', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Sitewide settings', 'wordpress-seo') . '</strong><br/>' . __('The first tab will show you site-wide settings. You can also set some settings for the entire site here to add specific meta tags or to remove some unneeded cruft.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Templates and settings', 'wordpress-seo') . '</strong><br/>' . sprintf(__('Now click on the \'%1$sPost Types%2$s\'-tab, as this will be our example.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url(admin_url('admin.php?page=wpseo_titles#top#post_types')) . '">', '</a>') . '<br />' . __('The templates are built using variables. You can find all these variables in the help tab (in the top-right corner of the page). The settings allow you to set specific behavior for the post types.', 'wordpress-seo') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_social') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_dashboard') . '";'), 'wpseo_social' => array('content' => '<h3>' . __('Social settings', 'wordpress-seo') . '</h3>' . '<p><strong>' . __('Facebook', 'wordpress-seo') . '</strong><br/>' . sprintf(__('On this tab you can enable the %1$sFacebook Open Graph%2$s functionality from this plugin, as well as assign a Facebook user or Application to be the admin of your site, so you can view the Facebook insights.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/facebook-open-graph-protocol/#utm_source=wpseo_social&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p><p>' . __('The frontpage settings allow you to set meta-data for your homepage, whereas the default settings allow you to set a fallback for all posts/pages without images. ', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Twitter', 'wordpress-seo') . '</strong><br/>' . sprintf(__('With %1$sTwitter Cards%2$s, you can attach rich photos, videos and media experience to tweets that drive traffic to your website. Simply check the box, sign up for the service, and users who Tweet links to your content will have a "Card" added to the tweet that\'s visible to all of their followers.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/twitter-cards/#utm_source=wpseo_social&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>' . '<p><strong>' . __('Google+', 'wordpress-seo') . '</strong><br/>' . sprintf(__('This tab allows you to add specific post meta data for Google+. And if you have a Google+ page for your business, add that URL here and link it on your %1$sGoogle+%2$s page\'s about page.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://plus.google.com/') . '">', '</a>') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_xml') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_titles') . '";'), 'wpseo_xml' => array('content' => '<h3>' . __('XML Sitemaps', 'wordpress-seo') . '</h3>' . '<p><strong>' . __('What are XML sitemaps?', 'wordpress-seo') . '</strong><br/>' . __('A Sitemap is an XML file that lists the URLs for a site. It allows webmasters to include additional information about each URL: when it was last updated, how often it changes, and how important it is in relation to other URLs in the site. This allows search engines to crawl the site more intelligently.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('What does the plugin do with XML Sitemaps?', 'wordpress-seo') . '</strong><br/>' . __('This plugin adds XML sitemaps to your site. The sitemaps are automatically updated when you publish a new post, page or custom post and Google and Bing will be automatically notified. You can also have the plugin automatically notify Yahoo! and Ask.com.', 'wordpress-seo') . '</p><p>' . __('If you want to exclude certain post types and/or taxonomies, you can also set that on this page.', 'wordpress-seo') . '</p><p>' . __('Is your webserver low on memory? Decrease the entries per sitemap (default: 1000) to reduce load.', 'wordpress-seo') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_permalinks') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_social') . '";'), 'wpseo_permalinks' => array('content' => '<h3>' . __('Permalink Settings', 'wordpress-seo') . '</h3><p>' . __('All of the options here are for advanced users only, if you don\'t know whether you should check any, don\'t touch them.', 'wordpress-seo') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_internal-links') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_xml') . '";'), 'wpseo_internal-links' => array('content' => '<h3>' . __('Breadcrumbs Settings', 'wordpress-seo') . '</h3><p>' . sprintf(__('If your theme supports my breadcrumbs, as all Genesis and WooThemes themes as well as a couple of other ones do, you can change the settings for those here. If you want to modify your theme to support them, %sfollow these instructions%s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/wordpress/plugins/breadcrumbs/#utm_source=wpseo_permalinks&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_rss') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_permalinks') . '";'), 'wpseo_rss' => array('content' => '<h3>' . __('RSS Settings', 'wordpress-seo') . '</h3><p>' . __('This incredibly powerful function allows you to add content to the beginning and end of your posts in your RSS feed. This helps you gain links from people who steal your content!', 'wordpress-seo') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_import') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_internal-links') . '";'), 'wpseo_import' => array('content' => '<h3>' . __('Import &amp; Export', 'wordpress-seo') . '</h3>' . '<p><strong>' . __('Import from other (SEO) plugins', 'wordpress-seo') . '</strong><br/>' . __('We can imagine that you switch from another SEO plugin to WordPress SEO. If you just did, you can use these options to transfer your SEO-data. If you were using one of my older plugins like Robots Meta &amp; RSS Footer, you can import the settings here too.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Other imports', 'wordpress-seo') . '</strong><br/>' . sprintf(__('If you\'re using one of our premium plugins, such as %1$sLocal SEO%2$s, you can also find specific import-options for that plugin here.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/wordpress/plugins/local-seo/#utm_source=wpseo_import&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>' . '<p><strong>' . __('Export', 'wordpress-seo') . '</strong><br/>' . __('If you have multiple blogs and you\'re happy with how you\'ve configured this blog, you can export the settings and import them on another blog so you don\'t have to go through this process twice!', 'wordpress-seo') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . network_admin_url('admin.php?page=wpseo_bulk-editor') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_rss') . '";'), 'wpseo_bulk-editor' => array('content' => '<h3>' . __('Bulk Editor', 'wordpress-seo') . '</h3><p>' . __('This page lets you view and edit the titles and meta descriptions of all posts and pages on your site. This allows you to edit the title or meta description of all your pages in one place, rather than having to edit each individual page.', 'wordpress-seo') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_files') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_import') . '";'), 'wpseo_files' => array('content' => '<h3>' . __('File Editor', 'wordpress-seo') . '</h3><p>' . __('Here you can edit the .htaccess and robots.txt files, two of the most powerful files in your WordPress install, if your WordPress installation has write-access to the files. But please, only touch these files if you know what you\'re doing!', 'wordpress-seo') . '</p>', 'next' => __('Next', 'wordpress-seo'), 'next_function' => 'window.location="' . admin_url('admin.php?page=wpseo_licenses') . '";', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_bulk-editor') . '";'), 'wpseo_licenses' => array('content' => '<h3>' . __('Extensions and Licenses', 'wordpress-seo') . '</h3>' . '<p><strong>' . __('Extensions', 'wordpress-seo') . '</strong><br/>' . sprintf(__('The powerful functions of WordPress SEO can be extended with %1$sYoast premium plugins%2$s. These premium plugins require the installation of WordPress SEO or WordPress SEO Premium and add specific functionality. You can read all about the Yoast Premium Plugins on %1$shttp://yoast.com/wordpress/plugins/%2$s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/wordpress/plugins/#utm_source=wpseo_licenses&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>' . '<p><strong>' . __('Licenses', 'wordpress-seo') . '</strong><br/>' . __('Once you\'ve purchased WordPress SEO Premium or any other premium Yoast plugin, you\'ll have to enter a license key. You can do so on the Licenses-tab. Once you\'ve activated your premium plugin, you can use all its powerful features.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Like this plugin?', 'wordpress-seo') . '</strong><br/>' . sprintf(__('So, we\'ve come to the end of the tour. If you like the plugin, please %srate it 5 stars on WordPress.org%s!', 'wordpress-seo'), '<a target="_blank" href="https://wordpress.org/plugins/wordpress-seo/">', '</a>') . '</p>' . '<p>' . sprintf(__('Thank you for using my plugin and good luck with your SEO!<br/><br/>Best,<br/>Team Yoast - %1$sYoast.com%2$s', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/#utm_source=wpseo_licenses&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>', 'prev' => __('Previous', 'wordpress-seo'), 'prev_function' => 'window.location="' . admin_url('admin.php?page=wpseo_files') . '";'));
     // Skip tour about wpseo_files page if file editing is disallowed or if the site is a multisite and the current user isn't a superadmin
     if (false === wpseo_allow_system_file_edit()) {
         unset($adminpages['wpseo_files']);
         $adminpages['wpseo_bulk-editor']['function'] = 'window.location="' . admin_url('admin.php?page=wpseo_licenses') . '";';
     }
     $page = '';
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
     }
     $button_array = array('button1' => array('text' => __('Close', 'wordpress-seo'), 'function' => ''));
     $opt_arr = array();
     $id = '#wpseo-title';
     if ('admin.php' != $pagenow || !array_key_exists($page, $adminpages)) {
         $id = 'li.toplevel_page_wpseo_dashboard';
         $content = '<h3>' . __('Congratulations!', 'wordpress-seo') . '</h3>';
         $content .= '<p>' . __('You\'ve just installed WordPress SEO by Yoast! Click "Start Tour" to view a quick introduction of this plugins core functionality.', 'wordpress-seo') . '</p>';
         $opt_arr = array('content' => $content, 'position' => array('edge' => 'top', 'align' => 'center'));
         $button_array['button2']['text'] = __('Start Tour', 'wordpress-seo');
         $button_array['button2']['function'] = 'document.location="' . admin_url('admin.php?page=wpseo_dashboard') . '";';
     } else {
         if ('' != $page && in_array($page, array_keys($adminpages))) {
             $align = is_rtl() ? 'left' : 'right';
             $opt_arr = array('content' => $adminpages[$page]['content'], 'position' => isset($adminpages[$page]['position']) ? $adminpages[$page]['position'] : array('edge' => 'top', 'align' => $align), 'pointerWidth' => 450);
             if (isset($adminpages[$page]['next']) && isset($adminpages[$page]['next_function'])) {
                 $button_array['button2'] = array('text' => $adminpages[$page]['next'], 'function' => $adminpages[$page]['next_function']);
             }
             if (isset($adminpages[$page]['prev']) && isset($adminpages[$page]['prev_function'])) {
                 $button_array['button3'] = array('text' => $adminpages[$page]['prev'], 'function' => $adminpages[$page]['prev_function']);
             }
         }
     }
     $this->print_scripts($id, $opt_arr, $button_array);
 }
示例#3
0
 /**
  * Register the settings page for the Network settings.
  */
 function register_network_settings_page()
 {
     if (WPSEO_Options::grant_access()) {
         // Base 64 encoded SVG image
         $icon_svg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCIgWw0KCTwhRU5USVRZIG5zX2Zsb3dzICJodHRwOi8vbnMuYWRvYmUuY29tL0Zsb3dzLzEuMC8iPg0KCTwhRU5USVRZIG5zX2V4dGVuZCAiaHR0cDovL25zLmFkb2JlLmNvbS9FeHRlbnNpYmlsaXR5LzEuMC8iPg0KCTwhRU5USVRZIG5zX2FpICJodHRwOi8vbnMuYWRvYmUuY29tL0Fkb2JlSWxsdXN0cmF0b3IvMTAuMC8iPg0KCTwhRU5USVRZIG5zX2dyYXBocyAiaHR0cDovL25zLmFkb2JlLmNvbS9HcmFwaHMvMS4wLyI+DQpdPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYWFnXzEiIHhtbG5zOng9IiZuc19leHRlbmQ7IiB4bWxuczppPSImbnNfYWk7IiB4bWxuczpncmFwaD0iJm5zX2dyYXBoczsiDQoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOmE9Imh0dHA6Ly9ucy5hZG9iZS5jb20vQWRvYmVTVkdWaWV3ZXJFeHRlbnNpb25zLzMuMC8iDQoJIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNDAgMzEuODkiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDQwIDMxLjg5IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTQwLDEyLjUyNEM0MCw1LjYwOCwzMS40NjksMCwyMCwwQzguNTMsMCwwLDUuNjA4LDAsMTIuNTI0YzAsNS41Niw1LjI0MywxMC4yNzIsMTMuNTU3LDExLjkwN3YtNC4wNjUNCgljMCwwLDAuMDQtMS0wLjI4LTEuOTJjLTAuMzItMC45MjEtMS43Ni0zLjAwMS0xLjc2LTUuMTIxYzAtMi4xMjEsMi41NjEtOS41NjMsNS4xMjItMTAuNDQ0Yy0wLjQsMS4yMDEtMC4zMiw3LjY4My0wLjMyLDcuNjgzDQoJczEuNCwyLjcyLDQuNjQxLDIuNzJjMy4yNDIsMCw0LjUxMS0xLjc2LDQuNzE1LTIuMmMwLjIwNi0wLjQ0LDAuODQ2LTguNzIzLDAuODQ2LTguNzIzczQuMDgyLDQuNDAyLDMuNjgyLDkuMzYzDQoJYy0wLjQwMSw0Ljk2Mi00LjQ4Miw3LjIwMy02LjEyMiw5LjEyM2MtMS4yODYsMS41MDUtMi4yMjQsMy4xMy0yLjYyOSw0LjE2OGMwLjgwMS0wLjAzNCwxLjU4Ny0wLjA5OCwyLjM2MS0wLjE4NGw5LjE1MSw3LjA1OQ0KCWwtNC44ODQtNy44M0MzNS41MzUsMjIuMTYxLDQwLDE3LjcxMyw0MCwxMi41MjR6Ii8+DQo8L2c+DQo8L3N2Zz4=';
         add_menu_page(__('Yoast WordPress SEO:', 'wordpress-seo') . ' ' . __('MultiSite Settings', 'wordpress-seo'), __('SEO', 'wordpress-seo'), 'delete_users', 'wpseo_dashboard', array($this, 'network_config_page'), $icon_svg);
         if (wpseo_allow_system_file_edit() === true) {
             add_submenu_page('wpseo_dashboard', __('Yoast WordPress SEO:', 'wordpress-seo') . ' ' . __('Edit Files', 'wordpress-seo'), __('Edit Files', 'wordpress-seo'), 'delete_users', 'wpseo_files', array($this, 'load_page'));
         }
         // Add Extension submenu page
         add_submenu_page('wpseo_dashboard', __('Yoast WordPress SEO:', 'wordpress-seo') . ' ' . __('Extensions', 'wordpress-seo'), __('Extensions', 'wordpress-seo'), 'delete_users', 'wpseo_licenses', array($this, 'load_page'));
     }
 }
示例#4
0
 /**
  * Register the settings page for the Network settings.
  */
 function register_network_settings_page()
 {
     if (WPSEO_Options::grant_access()) {
         add_menu_page(__('Yoast WordPress SEO:', 'wordpress-seo') . ' ' . __('MultiSite Settings', 'wordpress-seo'), __('SEO', 'wordpress-seo'), 'delete_users', 'wpseo_dashboard', array($this, 'network_config_page'), plugins_url('images/yoast-icon.png', WPSEO_FILE));
         if (wpseo_allow_system_file_edit() === true) {
             add_submenu_page('wpseo_dashboard', __('Yoast WordPress SEO:', 'wordpress-seo') . ' ' . __('Edit Files', 'wordpress-seo'), __('Edit Files', 'wordpress-seo'), 'delete_users', 'wpseo_files', array($this, 'load_page'));
         }
         // Add Extension submenu page
         add_submenu_page('wpseo_dashboard', __('Yoast WordPress SEO:', 'wordpress-seo') . ' ' . __('Extensions', 'wordpress-seo'), __('Extensions', 'wordpress-seo'), 'delete_users', 'wpseo_licenses', array($this, 'load_page'));
     }
 }
/**
 * Adds an SEO admin bar menu with several options. If the current user is an admin he can also go straight to several settings menu's from here.
 */
function wpseo_admin_bar_menu()
{
    // If the current user can't write posts, this is all of no use, so let's not output an admin menu
    if (!current_user_can('edit_posts')) {
        return;
    }
    global $wp_admin_bar, $wpseo_front, $post;
    $url = '';
    if (is_object($wpseo_front)) {
        $url = $wpseo_front->canonical(false);
    }
    $focuskw = '';
    $score = '';
    $seo_url = get_admin_url(null, 'admin.php?page=wpseo_dashboard');
    if ((is_singular() || is_admin() && in_array($GLOBALS['pagenow'], array('post.php', 'post-new.php'), true)) && isset($post) && is_object($post) && apply_filters('wpseo_use_page_analysis', true) === true) {
        $focuskw = WPSEO_Meta::get_value('focuskw', $post->ID);
        $perc_score = WPSEO_Meta::get_value('linkdex', $post->ID);
        $calc_score = wpseo_calc($perc_score, '/', 10, true);
        $txtscore = wpseo_translate_score($calc_score);
        $title = wpseo_translate_score($calc_score, false);
        $score = '<div title="' . esc_attr($title) . '" class="' . esc_attr('wpseo-score-icon ' . $txtscore . ' ' . $perc_score) . '"></div>';
        $seo_url = get_edit_post_link($post->ID);
        if ($txtscore !== 'na') {
            $seo_url .= '#wpseo_linkdex';
        }
    }
    $wp_admin_bar->add_menu(array('id' => 'wpseo-menu', 'title' => __('SEO', 'wordpress-seo') . $score, 'href' => $seo_url));
    $wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-kwresearch', 'title' => __('Keyword Research', 'wordpress-seo'), '#'));
    $wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-adwordsexternal', 'title' => __('AdWords External', 'wordpress-seo'), 'href' => 'http://adwords.google.com/keywordplanner', 'meta' => array('target' => '_blank')));
    $wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-googleinsights', 'title' => __('Google Insights', 'wordpress-seo'), 'href' => 'http://www.google.com/insights/search/#q=' . urlencode($focuskw) . '&cmpt=q', 'meta' => array('target' => '_blank')));
    $wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-wordtracker', 'title' => __('SEO Book', 'wordpress-seo'), 'href' => 'http://tools.seobook.com/keyword-tools/seobook/?keyword=' . urlencode($focuskw), 'meta' => array('target' => '_blank')));
    if (!is_admin()) {
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-analysis', 'title' => __('Analyze this page', 'wordpress-seo'), '#'));
        if (is_string($url)) {
            // @todo [JRF => whomever] check if this url shouldn't be encoded either with urlencode or with esc_url or something
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-inlinks-ose', 'title' => __('Check Inlinks (OSE)', 'wordpress-seo'), 'href' => '//moz.com/researchtools/ose/links?site=' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-kwdensity', 'title' => __('Check Keyword Density', 'wordpress-seo'), 'href' => '//www.zippy.co.uk/keyworddensity/index.php?url=' . urlencode($url) . '&keyword=' . urlencode($focuskw), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-cache', 'title' => __('Check Google Cache', 'wordpress-seo'), 'href' => '//webcache.googleusercontent.com/search?strip=1&q=cache:' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-header', 'title' => __('Check Headers', 'wordpress-seo'), 'href' => '//quixapp.com/headers/?r=' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-richsnippets', 'title' => __('Check Rich Snippets', 'wordpress-seo'), 'href' => '//www.google.com/webmasters/tools/richsnippets?q=' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-facebookdebug', 'title' => __('Facebook Debugger', 'wordpress-seo'), 'href' => '//developers.facebook.com/tools/debug/og/object?q=' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-pinterestvalidator', 'title' => __('Pinterest Rich Pins Validator', 'wordpress-seo'), 'href' => '//developers.pinterest.com/rich_pins/validator/?link=' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-htmlvalidation', 'title' => __('HTML Validator', 'wordpress-seo'), 'href' => '//validator.w3.org/check?uri=' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-cssvalidation', 'title' => __('CSS Validator', 'wordpress-seo'), 'href' => '//jigsaw.w3.org/css-validator/validator?uri=' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-pagespeed', 'title' => __('Google Page Speed Test', 'wordpress-seo'), 'href' => '//developers.google.com/speed/pagespeed/insights/?url=' . urlencode($url), 'meta' => array('target' => '_blank')));
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-modernie', 'title' => __('Modern IE Site Scan', 'wordpress-seo'), 'href' => '//www.modern.ie/en-us/report#' . urlencode($url), 'meta' => array('target' => '_blank')));
        }
    }
    $admin_menu = false;
    if (is_multisite()) {
        $options = get_site_option('wpseo_ms');
        if ($options['access'] === 'superadmin' && is_super_admin()) {
            $admin_menu = true;
        } elseif (current_user_can('manage_options')) {
            $admin_menu = true;
        }
    } elseif (current_user_can('manage_options')) {
        $admin_menu = true;
    }
    // @todo: add links to bulk title and bulk description edit pages
    if ($admin_menu) {
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-settings', 'title' => __('SEO Settings', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_titles')));
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-titles', 'title' => __('Titles &amp; Metas', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_titles')));
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-social', 'title' => __('Social', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_social')));
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-xml', 'title' => __('XML Sitemaps', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_xml')));
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-permalinks', 'title' => __('Permalinks', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_permalinks')));
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-internal-links', 'title' => __('Internal Links', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_internal-links')));
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-rss', 'title' => __('RSS', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_rss')));
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-import', 'title' => esc_html__('Import & Export', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_import')));
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo_bulk-editor', 'title' => __('Bulk Editor', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_bulk-editor')));
        // Check where to add the edit files page
        if (wpseo_allow_system_file_edit() === true) {
            $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-files', 'title' => __('Edit Files', 'wordpress-seo'), 'href' => network_admin_url('admin.php?page=wpseo_files')));
            // will auto-use admin_url if not in multi-site
        }
        $wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-licenses', 'title' => __('Extensions', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_licenses')));
    }
}