/**
  * Handling the request to create a new redirect from the issued URL
  */
 public function ajax_create_redirect()
 {
     if ($this->valid_nonce() && class_exists('WPSEO_Redirect_Manager') && defined('WPSEO_PREMIUM_PATH')) {
         $redirect_manager = new WPSEO_Redirect_Manager();
         $old_url = filter_input(INPUT_POST, 'old_url');
         // Creates the redirect.
         $redirect = new WPSEO_Redirect($old_url, filter_input(INPUT_POST, 'new_url'), filter_input(INPUT_POST, 'type'));
         if ($redirect_manager->create_redirect($redirect)) {
             if (filter_input(INPUT_POST, 'mark_as_fixed') === 'true') {
                 new WPSEO_GSC_Marker($old_url);
             }
             wp_die('true');
         }
     }
     wp_die('false');
 }
 /**
  * Get crawl issues
  *
  * @param $site_url
  *
  * @return array
  */
 public function get_crawl_issues()
 {
     // Setup crawl error list
     $crawl_issues = array();
     // Issues per page
     $per_page = 100;
     $cur_page = 0;
     // We always have issues on first request
     $has_more_issues = true;
     $crawl_issue_manager = new WPSEO_Crawl_Issue_Manager();
     $profile_url = $crawl_issue_manager->get_profile();
     // Do multiple request
     while (true === $has_more_issues) {
         // Set issues to false
         $has_more_issues = false;
         // Do request
         $url = $profile_url . "/crawlissues/?start-index=" . ($per_page * $cur_page + 1) . "&max-results=" . $per_page;
         $request = new Google_HttpRequest($url);
         // Get list sites response
         $response = $this->client->getIo()->authenticatedRequest($request);
         // Check response code
         if ('200' == $response->getResponseHttpCode()) {
             // Create XML object from reponse body
             $response_xml = simplexml_load_string($response->getResponseBody());
             // Check if we got entries
             if (count($response_xml->entry) > 0) {
                 // Count, future use itemsperpage in Google reponse
                 if (100 == count($response_xml->entry)) {
                     // We have issues
                     $has_more_issues = true;
                 }
                 // Loop
                 foreach ($response_xml->entry as $entry) {
                     $wt = $entry->children('wt', true);
                     $crawl_issues[] = new WPSEO_Crawl_Issue(WPSEO_Redirect_Manager::format_url((string) $wt->url), (string) $wt->{'crawl-type'}, (string) $wt->{'issue-type'}, new DateTime((string) $wt->{'date-detected'}), (string) $wt->{'detail'}, (array) $wt->{'linked-from'}, false);
                 }
             }
         }
         // Up page nr
         $cur_page++;
     }
     return $crawl_issues;
 }
 /**
  * Instantiate all the needed redirect functions
  */
 private function instantiate_redirects()
 {
     $normal_redirect_manager = new WPSEO_URL_Redirect_Manager();
     $regex_redirect_manager = new WPSEO_REGEX_Redirect_Manager();
     if (is_admin()) {
         // Check if WPSEO_DISABLE_PHP_REDIRECTS is defined.
         if (defined('WPSEO_DISABLE_PHP_REDIRECTS') && true === WPSEO_DISABLE_PHP_REDIRECTS) {
             // Change the normal redirect autoload option.
             $normal_redirect_manager->redirects_change_autoload(false);
             // Change the regex redirect autoload option.
             $regex_redirect_manager->redirects_change_autoload(false);
         } else {
             $options = WPSEO_Redirect_Manager::get_options();
             // If the disable_php_redirect option is not enabled we should enable auto loading redirects.
             if ('off' == $options['disable_php_redirect']) {
                 // Change the normal redirect autoload option.
                 $normal_redirect_manager->redirects_change_autoload(true);
                 // Change the regex redirect autoload option.
                 $regex_redirect_manager->redirects_change_autoload(true);
             }
         }
     }
     if (defined('DOING_AJAX') && DOING_AJAX) {
         // Normal Redirect AJAX.
         add_action('wp_ajax_wpseo_save_redirect_url', array($normal_redirect_manager, 'ajax_handle_redirect_save'));
         add_action('wp_ajax_wpseo_delete_redirect_url', array($normal_redirect_manager, 'ajax_handle_redirect_delete'));
         add_action('wp_ajax_wpseo_create_redirect_url', array($normal_redirect_manager, 'ajax_handle_redirect_create'));
         // Regex Redirect AJAX.
         add_action('wp_ajax_wpseo_save_redirect_regex', array($regex_redirect_manager, 'ajax_handle_redirect_save'));
         add_action('wp_ajax_wpseo_delete_redirect_regex', array($regex_redirect_manager, 'ajax_handle_redirect_delete'));
         add_action('wp_ajax_wpseo_create_redirect_regex', array($regex_redirect_manager, 'ajax_handle_redirect_create'));
         // Add URL reponse code check AJAX.
         add_action('wp_ajax_wpseo_check_url', array('WPSEO_Url_Checker', 'check_url'));
     } else {
         // Catch redirect.
         add_action('template_redirect', array($normal_redirect_manager, 'do_redirects'), -999);
         // Catch regex redirects.
         add_action('template_redirect', array($regex_redirect_manager, 'do_redirects'), -999);
     }
 }
 /**
  * Setup the premium WordPress SEO plugin
  */
 private function setup()
 {
     // Setup autoloader
     require_once dirname(__FILE__) . '/classes/class-premium-autoloader.php';
     $autoloader = new WPSEO_Premium_Autoloader();
     spl_autoload_register(array($autoloader, 'load'));
     if (is_admin()) {
         // Upgrade Manager
         $plugin_updater = new WPSEO_Upgrade_Manager();
         $plugin_updater->check_update();
         // Create pages
         $this->page_gwt = new WPSEO_Page_GWT();
         // Disable WordPress SEO
         add_action('admin_init', array($this, 'disable_wordpress_seo'), 1);
         // Add Sub Menu page and add redirect page to admin page array
         // This should be possible in one method in the future, see #535
         add_filter('wpseo_submenu_pages', array($this, 'add_submenu_pages'));
         // Add Redirect page as admin page
         add_filter('wpseo_admin_pages', array($this, 'add_admin_pages'));
         // Post to Get on search
         add_action('admin_init', array($this, 'list_table_search_post_to_get'));
         // Add the GWT crawl error post type
         add_action('admin_init', array($this, 'register_gwt_crawl_error_post_type'));
         // Add input fields to page meta post types
         add_action('wpseo_admin_page_meta_post_types', array($this, 'admin_page_meta_post_types_checkboxes'), 10, 2);
         // Add page analysis fields to variable array key patterns
         add_filter('wpseo_option_titles_variable_array_key_patterns', array($this, 'add_variable_array_key_pattern'));
         // Filter the Page Analysis content
         add_filter('wpseo_pre_analysis_post_content', array($this, 'filter_page_analysis'), 10, 2);
         // Check if WPSEO_DISABLE_PHP_REDIRECTS is defined
         if (defined('WPSEO_DISABLE_PHP_REDIRECTS') && true === WPSEO_DISABLE_PHP_REDIRECTS) {
             // Change the normal redirect autoload option
             $normal_redirect_manager = new WPSEO_URL_Redirect_Manager();
             $normal_redirect_manager->redirects_change_autoload(false);
             // Change the regex redirect autoload option
             $regex_redirect_manager = new WPSEO_REGEX_Redirect_Manager();
             $regex_redirect_manager->redirects_change_autoload(false);
         } else {
             $options = WPSEO_Redirect_Manager::get_options();
             // If the disable_php_redirect option is not enabled we should enable auto loading redirects
             if ('off' == $options['disable_php_redirect']) {
                 // Change the normal redirect autoload option
                 $normal_redirect_manager = new WPSEO_URL_Redirect_Manager();
                 $normal_redirect_manager->redirects_change_autoload(true);
                 // Change the regex redirect autoload option
                 $regex_redirect_manager = new WPSEO_REGEX_Redirect_Manager();
                 $regex_redirect_manager->redirects_change_autoload(true);
             }
         }
         // Settings
         add_action('admin_init', array($this, 'register_settings'));
         // Check if we need to save files after updating options
         add_action('update_option_wpseo_redirect', array($this, 'save_redirect_files'), 10, 2);
         // Catch option save
         add_action('admin_init', array($this, 'catch_option_redirect_save'));
         // Screen options
         $query_var = !empty($_GET['page']) ? $_GET['page'] : '';
         switch ($query_var) {
             case 'wpseo_redirects':
                 add_filter('set-screen-option', array('WPSEO_Page_Redirect', 'set_screen_option'), 11, 3);
                 break;
             case 'wpseo_webmaster_tools':
                 add_filter('set-screen-option', array($this->page_gwt, 'set_screen_option'), 11, 3);
                 break;
         }
         // Enqueue Post and Term overview script
         add_action('admin_enqueue_scripts', array($this, 'enqueue_overview_script'));
         // Licensing part
         $license_manager = new Yoast_Plugin_License_Manager(new WPSEO_Product_Premium());
         // Setup constant name
         $license_manager->set_license_constant_name('WPSEO_LICENSE');
         // Setup license hooks
         $license_manager->setup_hooks();
         // Add this plugin to licensing form
         add_action('wpseo_licenses_forms', array($license_manager, 'show_license_form'));
         if ($license_manager->license_is_valid()) {
             add_action('admin_head', array($this, 'admin_css'));
         }
         // Crawl Issue Manager AJAX hooks
         $crawl_issue_manager = new WPSEO_Crawl_Issue_Manager();
         add_action('wp_ajax_wpseo_ignore_crawl_issue', array($crawl_issue_manager, 'ajax_ignore_crawl_issue'));
         add_action('wp_ajax_wpseo_unignore_crawl_issue', array($crawl_issue_manager, 'ajax_unignore_crawl_issue'));
         // Add Premium imports
         $premium_import_manager = new WPSEO_Premium_Import_Manager();
         // Allow option of importing from other 'other' plugins
         add_filter('wpseo_import_other_plugins', array($premium_import_manager, 'filter_add_premium_import_options'));
         // Handle premium imports
         add_action('wpseo_handle_import', array($premium_import_manager, 'do_premium_imports'));
         // Add htaccess import block
         add_action('wpseo_import', array($premium_import_manager, 'add_htaccess_import_block'));
         // Only activate post and term watcher if permalink structure is enabled
         if (get_option('permalink_structure')) {
             // The Post Watcher
             $post_watcher = new WPSEO_Post_Watcher();
             // Add old URL field to post edit screen
             add_action('edit_form_advanced', array($post_watcher, 'old_url_field'), 10, 1);
             add_action('edit_page_form', array($post_watcher, 'old_url_field'), 10, 1);
             // Detect a post slug change
             add_action('post_updated', array($post_watcher, 'detect_slug_change'), 12, 3);
             // Detect a post trash
             add_action('trashed_post', array($post_watcher, 'detect_post_trash'));
             // Detect a post untrash
             add_action('untrashed_post', array($post_watcher, 'detect_post_untrash'));
             // Detect a post delete
             add_action('delete_post', array($post_watcher, 'detect_post_delete'));
             // The Term Watcher
             $term_watcher = new WPSEO_Term_Watcher();
             // Get all taxonomies
             $taxonomies = get_taxonomies();
             // Loop through all taxonomies
             if (count($taxonomies) > 0) {
                 foreach ($taxonomies as $taxonomy) {
                     // Add old URL field to term edit screen
                     add_action($taxonomy . '_edit_form_fields', array($term_watcher, 'old_url_field'), 10, 2);
                 }
             }
             // Detect the term slug change
             add_action('edited_term', array($term_watcher, 'detect_slug_change'), 10, 3);
             // Detect a term delete
             add_action('delete_term_taxonomy', array($term_watcher, 'detect_term_delete'));
             // Check if we need to display an admin message
             if (isset($_GET['yoast-redirect-created'])) {
                 // Message object
                 $message = new WPSEO_Message_Redirect_Created($_GET['yoast-redirect-created']);
                 add_action('all_admin_notices', array($message, 'display'));
             }
         }
     } else {
         // Catch redirect
         $normal_redirect_manager = new WPSEO_URL_Redirect_Manager();
         add_action('template_redirect', array($normal_redirect_manager, 'do_redirects'));
         // Catch redirect
         $regex_redirect_manager = new WPSEO_REGEX_Redirect_Manager();
         add_action('template_redirect', array($regex_redirect_manager, 'do_redirects'));
         // Add 404 redirect link to WordPress toolbar
         add_action('admin_bar_menu', array($this, 'admin_bar_menu'), 96);
         add_filter('redirect_canonical', array($this, 'redirect_canonical_fix'), 1, 2);
     }
     // Normal Redirect AJAX
     $redirect_manager = new WPSEO_URL_Redirect_Manager();
     add_action('wp_ajax_wpseo_save_redirect_url', array($redirect_manager, 'ajax_handle_redirect_save'));
     add_action('wp_ajax_wpseo_delete_redirect_url', array($redirect_manager, 'ajax_handle_redirect_delete'));
     add_action('wp_ajax_wpseo_create_redirect_url', array($redirect_manager, 'ajax_handle_redirect_create'));
     // Regex Redirect AJAX
     $redirect_manager = new WPSEO_REGEX_Redirect_Manager();
     add_action('wp_ajax_wpseo_save_redirect_regex', array($redirect_manager, 'ajax_handle_redirect_save'));
     add_action('wp_ajax_wpseo_delete_redirect_regex', array($redirect_manager, 'ajax_handle_redirect_delete'));
     add_action('wp_ajax_wpseo_create_redirect_regex', array($redirect_manager, 'ajax_handle_redirect_create'));
     // Add URL reponse code check AJAX
     add_action('wp_ajax_wpseo_check_url', array('WPSEO_Url_Checker', 'check_url'));
 }
    /**
     * Function that outputs the redirect page
     */
    public static function display()
    {
        // Check if there's an old URL set.
        $old_url = '';
        if (($old_url = filter_input(INPUT_GET, 'old_url')) != '') {
            $old_url = urldecode($old_url);
        }
        // Get the redirect types.
        $redirect_types = WPSEO_Redirect_Manager::get_redirect_types();
        // Admin header.
        Yoast_Form::get_instance()->admin_header(false, 'wpseo_redirects', false, 'yoast_wpseo_redirects_options');
        ?>
		<h2 class="nav-tab-wrapper" id="wpseo-tabs">
			<a class="nav-tab" id="tab-url-tab"
			   href="#top#tab-url"><?php 
        _e('Redirects', 'wordpress-seo-premium');
        ?>
</a>
			<a class="nav-tab" id="tab-regex-tab"
			   href="#top#tab-regex"><?php 
        _e('Regex Redirects', 'wordpress-seo-premium');
        ?>
</a>
			<a class="nav-tab" id="settings-tab"
			   href="#top#settings"><?php 
        _e('Settings', 'wordpress-seo-premium');
        ?>
</a>
		</h2>

		<div class="tabwrapper>">
			<div id="tab-url" class="wpseotab redirect-table-tab">
				<?php 
        // Add new redirect HTML.
        echo "<form class='wpseo-new-redirect-form' method='post'>\n";
        echo "<div class='wpseo_redirects_new'>\n";
        // Echo "<h2>" . __( 'Add New Redirect', 'wordpress-seo' ) . "</h2>\n";.
        echo "<label class='textinput' for='wpseo_redirects_new_old'>" . __('Old URL', 'wordpress-seo-premium') . "</label>\n";
        echo "<input type='text' class='textinput' name='wpseo_redirects_new_old' id='wpseo_redirects_new_old' value='", esc_url($old_url) . "' />\n";
        echo "<br class='clear'/>\n";
        echo "<label class='textinput' for='wpseo_redirects_new_new'>" . __('New URL', 'wordpress-seo-premium') . "</label>\n";
        echo "<input type='text' class='textinput' name='wpseo_redirects_new_new' id='wpseo_redirects_new_new' value='' />\n";
        echo "<br class='clear'/>\n";
        echo "<label class='textinput' for='wpseo_redirects_new_type'>" . _x('Type', 'noun', 'wordpress-seo-premium') . "</label>\n";
        // Redirect type select element.
        echo "<select name='wpseo_redirects_new_type' id='wpseo_redirects_new_type' class='select'>" . PHP_EOL;
        // Loop through the redirect types.
        if (count($redirect_types) > 0) {
            foreach ($redirect_types as $type => $desc) {
                echo "<option value='" . $type . "'>" . $desc . '</option>' . PHP_EOL;
            }
        }
        echo '</select>' . PHP_EOL;
        echo '<br />';
        echo '<br />';
        echo '<p class="label desc description">' . sprintf(__('The redirect type is the HTTP response code sent to the browser telling the browser what type of redirect is served.<br/><br/>Read <a href=\'%s\' target=\'_blank\'>this page</a> for more info.', 'wordpress-seo-premium'), 'http://kb.yoast.com/article/121-redirect-types/#utm_source=wordpress-seo-premium-redirects&amp;utm_medium=inline-help&amp;utm_campaign=redirect-types') . '</p>';
        echo "<br class='clear'/>\n";
        echo "<a href='javascript:;' class='button-primary'>" . __('Add Redirect', 'wordpress-seo-premium') . "</a>\n";
        echo "</div>\n";
        echo "</form>\n";
        echo "<p class='desc'>&nbsp;</p>\n";
        // Open <form>.
        echo "<form id='url' class='wpseo-redirects-table-form' method='post' action=''>\n";
        // AJAX nonce.
        echo "<input type='hidden' class='wpseo_redirects_ajax_nonce' value='" . wp_create_nonce('wpseo-redirects-ajax-security') . "' />\n";
        // The list table.
        $list_table = new WPSEO_Redirect_Table('URL');
        $list_table->prepare_items();
        $list_table->search_box(__('Search', 'wordpress-seo-premium'), 'wpseo-redirect-search');
        $list_table->display();
        // Close <form>.
        echo "</form>\n";
        ?>
			</div>
			<div id="tab-regex" class="wpseotab redirect-table-tab">
				<?php 
        // Add new redirect HTML.
        /* translators: %1$s contains a line break tag. %2$s links to our knowledge base, %3$s closes the link. */
        echo '<p>' . sprintf(__('Regex Redirects are extremely powerful redirects. You should only use them if you know what you are doing.%1$sIf you don\'t know what Regular Expressions (regex) are, please refer to %2$sour knowledge base%3$s.', 'wordpress-seo-premium'), '<br />', '<a href="http://kb.yoast.com/article/142-what-are-regex-redirects" target="_blank">', '</a>') . "</p>\n";
        echo "<form class='wpseo-new-redirect-form' method='post'>\n";
        echo "<div class='wpseo_redirects_new'>\n";
        // Echo "<h2>" . __( 'Add New Regex Redirect', 'wordpress-seo' ) . "</h2>\n";.
        echo "<label class='textinput' for='wpseo_redirects_new_old'>" . __('Regular Expression', 'wordpress-seo-premium') . "</label>\n";
        echo "<input type='text' class='textinput' name='wpseo_redirects_new_old' id='wpseo_redirects_new_old' value='{$old_url}' />\n";
        echo "<br class='clear'/>\n";
        echo "<label class='textinput' for='wpseo_redirects_new_new'>" . __('URL', 'wordpress-seo-premium') . "</label>\n";
        echo "<input type='text' class='textinput' name='wpseo_redirects_new_new' id='wpseo_redirects_new_new' value='' />\n";
        echo "<br class='clear'/>\n";
        echo "<label class='textinput' for='wpseo_redirects_new_type'>" . _x('Type', 'noun', 'wordpress-seo-premium') . "</label>\n";
        // Redirect type select element.
        echo "<select name='wpseo_redirects_new_type' id='wpseo_redirects_new_type' class='select'>" . PHP_EOL;
        // Loop through the redirect types.
        if (count($redirect_types) > 0) {
            foreach ($redirect_types as $key => $desc) {
                echo "<option value='" . $key . "'>" . $desc . '</option>' . PHP_EOL;
            }
        }
        echo '</select>' . PHP_EOL;
        echo '<br />';
        echo '<br />';
        echo '<p class="label desc description">' . sprintf(__('The redirect type is the HTTP response code sent to the browser telling the browser what type of redirect is served.<br/><br/>Read <a href=\'%s\' target=\'_blank\'>this page</a> for more info.', 'wordpress-seo-premium'), 'http://kb.yoast.com/article/121-redirect-types/#utm_source=wordpress-seo-premium-redirects&amp;utm_medium=inline-help&amp;utm_campaign=redirect-types') . ' </p>';
        echo "<br class='clear'/>\n";
        echo "<a href='javascript:;' class='button-primary'>" . __('Add Redirect', 'wordpress-seo-premium') . "</a>\n";
        echo "</div>\n";
        echo "</form>\n";
        echo "<p class='desc'>&nbsp;</p>\n";
        // Open <form>.
        echo "<form id='regex' class='wpseo-redirects-table-form' method='post' action=''>\n";
        // AJAX nonce.
        echo "<input type='hidden' class='wpseo_redirects_ajax_nonce' value='" . wp_create_nonce('wpseo-redirects-ajax-security') . "' />\n";
        // The list table.
        $list_table = new WPSEO_Redirect_Table('REGEX');
        $list_table->prepare_items();
        $list_table->search_box(__('Search', 'wordpress-seo-premium'), 'wpseo-redirect-search');
        $list_table->display();
        // Close <form>.
        echo "</form>\n";
        ?>
			</div>
			<div id="settings" class="wpseotab">
				<?php 
        // Get redirect options.
        $redirect_options = WPSEO_Redirect_Manager::get_options();
        // Do file checks.
        if ('on' == $redirect_options['disable_php_redirect']) {
            $file_write_error = false;
            if (WPSEO_Utils::is_apache()) {
                if ('on' == $redirect_options['separate_file']) {
                    if (file_exists(WPSEO_Redirect_File_Manager::get_file_path())) {
                        echo '<div style="margin: 5px 0; padding: 3px 10px; background-color: #ffffe0; border: 1px solid #E6DB55; border-radius: 3px">';
                        echo '<p>' . __("As you're on Apache, you should add the following include to the website httpd config file:", 'wordpress-seo-premium') . '</p>';
                        echo '<pre>Include ' . WPSEO_Redirect_File_Manager::get_file_path() . '</pre>';
                        echo '</div>';
                    } else {
                        $file_write_error = true;
                    }
                } else {
                    if (!is_writable(WPSEO_Redirect_File_Manager::get_htaccess_file_path())) {
                        /* translators: %s: '.htaccess' file name */
                        echo "<div class='error'><p><b>" . sprintf(__('We\'re unable to save the redirects to your %s file. Please make the file writable.', 'wordpress-seo-premium'), '<code>.htaccess</code>') . "</b></p></div>\n";
                    }
                }
            } else {
                if (WPSEO_Utils::is_nginx()) {
                    if (file_exists(WPSEO_Redirect_File_Manager::get_file_path())) {
                        echo '<div style="margin: 5px 0; padding: 3px 10px; background-color: #ffffe0; border: 1px solid #E6DB55; border-radius: 3px">';
                        echo '<p>' . __('As you\'re on Nginx, you should add the following include to the NGINX config file:', 'wordpress-seo-premium') . '</p>';
                        echo '<pre>include ' . WPSEO_Redirect_File_Manager::get_file_path() . ';</pre>';
                        echo '</div>';
                    } else {
                        $file_write_error = true;
                    }
                }
            }
            if ($file_write_error) {
                echo "<div class='error'><p><b>" . __(sprintf("We're unable to save the redirect file to %s", WPSEO_Redirect_File_Manager::get_file_path()), 'wordpress-seo-premium') . "</b></p></div>\n";
            }
        }
        ?>
				<h2>Redirect Settings</h2>

				<form action="<?php 
        echo admin_url('options.php');
        ?>
" method="post">
					<?php 
        settings_fields('yoast_wpseo_redirect_options');
        Yoast_Form::get_instance()->set_option('wpseo_redirect');
        if (WPSEO_Utils::is_apache()) {
            echo Yoast_Form::get_instance()->checkbox('disable_php_redirect', __('Disable PHP redirects', 'wordpress-seo-premium'));
            /* translators: 1: '.htaccess' file name */
            echo '<p class="desc">' . sprintf(__('Write redirects to the %1$s file. Make sure the %1$s file is writable.', 'wordpress-seo-premium'), '<code>.htacces</code>') . '</p>';
            echo Yoast_Form::get_instance()->checkbox('separate_file', __('Generate a separate redirect file', 'wordpress-seo-premium'));
            /* translators: %s: '.htaccess' file name */
            echo '<p class="desc">' . sprintf(__('By default we write the redirects to your %s file, check this if you want the redirects written to a separate file. Only check this option if you know what you are doing!', 'wordpress-seo-premium'), '<code>.htaccess</code>') . '</p>';
        } else {
            echo Yoast_Form::get_instance()->checkbox('disable_php_redirect', __('Disable PHP redirects', 'wordpress-seo-premium'));
            /* translators: %s: 'Yoast SEO Premium' */
            echo '<p class="desc">' . sprintf(__('%s will generate redirect files that can be included in your website configuration. You can disable PHP redirect if this is done correctly. Only check this option if you know what you are doing!', 'wordpress-seo-premium'), 'Yoast SEO Premium') . '</p>';
        }
        ?>
					<p class="submit">
						<input type="submit" name="submit" id="submit" class="button button-primary"
						       value="<?php 
        _e('Save Changes', 'wordpress-seo-premium');
        ?>
">
					</p>
				</form>
			</div>
		</div>
		<br class="clear">
		<?php 
        // Admin footer.
        Yoast_Form::get_instance()->admin_footer(false);
    }
 /**
  * Determine which model box type should be rendered
  *
  * @param string $url              URL string.
  * @param string $current_redirect Current redirect by reference.
  *
  * @return string
  */
 private function modal_box_type($url, &$current_redirect)
 {
     if (defined('WPSEO_PREMIUM_FILE') && class_exists('WPSEO_Redirect_Manager')) {
         static $redirect_manager;
         if (!$redirect_manager) {
             $redirect_manager = new WPSEO_Redirect_Manager();
         }
         if ($current_redirect = $redirect_manager->get_redirect($url)) {
             return 'already_exists';
         }
         return 'create';
     }
     return 'no_premium';
 }