Пример #1
0
<?php

/**
 * @package YMBESEO\Admin
 */
if (!defined('YMBESEO_VERSION')) {
    header('Status: 403 Forbidden');
    header('HTTP/1.1 403 Forbidden');
    exit;
}
$tool_page = (string) filter_input(INPUT_GET, 'tool');
$yform = Yoast_Form::get_instance();
$yform->admin_header(false);
if ('' === $tool_page) {
    $tools = array('bulk-editor' => array('title' => __('Bulk editor', 'ymbeseo'), 'desc' => __('This tool allows you to quickly change titles and descriptions of your posts and pages without having to go into the editor for each page.', 'ymbeseo')), 'import-export' => array('title' => __('Import and Export', 'ymbeseo'), 'desc' => __('Import settings from other SEO plugins and export your settings for re-use on (another) blog.', 'ymbeseo')));
    if (YMBESEO_Utils::allow_system_file_edit() === true && !is_multisite()) {
        $tools['file-editor'] = array('title' => __('File editor', 'ymbeseo'), 'desc' => __('This tool allows you to quickly change important files for your SEO, like your robots.txt and, if you have one, your .htaccess file.', 'ymbeseo'));
    }
    /* translators: %1$s expands to Yoast SEO */
    echo '<p>', sprintf(__('%1$s comes with some very powerful built-in tools:', 'ymbeseo'), 'Yoast SEO'), '</p>';
    asort($tools);
    echo '<ul class="ul-disc">';
    foreach ($tools as $slug => $tool) {
        echo '<li>';
        echo '<strong><a href="', admin_url('admin.php?page=YMBESEO_tools&tool=' . $slug), '">', $tool['title'], '</a></strong><br/>';
        echo $tool['desc'];
        echo '</li>';
    }
    echo '</ul>';
} else {
    echo '<a href="', admin_url('admin.php?page=YMBESEO_tools'), '">', __('&laquo; Back to Tools page', 'ymbeseo'), '</a>';
Пример #2
0
 /**
  * Register the settings page for the Network settings.
  */
 function register_network_settings_page()
 {
     if (YMBESEO_Utils::grant_access()) {
         // Base 64 encoded SVG image.
         $icon_svg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYX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TIxYzAtMi4xMjEsMi41NjEtOS41NjMsNS4xMjItMTAuNDQ0Yy0wLjQsMS4yMDEtMC4zMiw3LjY4My0wLjMyLDcuNjgzDQoJczEuNCwyLjcyLDQuNjQxLDIuNzJjMy4yNDIsMCw0LjUxMS0xLjc2LDQuNzE1LTIuMmMwLjIwNi0wLjQ0LDAuODQ2LTguNzIzLDAuODQ2LTguNzIzczQuMDgyLDQuNDAyLDMuNjgyLDkuMzYzDQoJYy0wLjQwMSw0Ljk2Mi00LjQ4Miw3LjIwMy02LjEyMiw5LjEyM2MtMS4yODYsMS41MDUtMi4yMjQsMy4xMy0yLjYyOSw0LjE2OGMwLjgwMS0wLjAzNCwxLjU4Ny0wLjA5OCwyLjM2MS0wLjE4NGw5LjE1MSw3LjA1OQ0KCWwtNC44ODQtNy44M0MzNS41MzUsMjIuMTYxLDQwLDE3LjcxMyw0MCwxMi41MjR6Ii8+DQo8L2c+DQo8L3N2Zz4=';
         add_menu_page('Yoast SEO: ' . __('MultiSite Settings', 'ymbeseo'), __('SEO', 'ymbeseo'), 'delete_users', 'YMBESEO_dashboard', array($this, 'network_config_page'), $icon_svg);
         if (YMBESEO_Utils::allow_system_file_edit() === true) {
             add_submenu_page('YMBESEO_dashboard', 'Yoast SEO: ' . __('Edit Files', 'ymbeseo'), __('Edit Files', 'ymbeseo'), 'delete_users', 'YMBESEO_files', array($this, 'load_page'));
         }
         // Add Extension submenu page.
         add_submenu_page('YMBESEO_dashboard', 'Yoast SEO: ' . __('Extensions', 'ymbeseo'), __('Extensions', 'ymbeseo'), 'delete_users', 'YMBESEO_licenses', array($this, 'load_page'));
     }
 }
/**
 * Check whether file editing is allowed for the .htaccess and robots.txt files
 *
 * @deprecated 1.5.6.1
 * @deprecated use YMBESEO_Utils::allow_system_file_edit()
 * @see        YMBESEO_Utils::allow_system_file_edit()
 *
 * @internal   current_user_can() checks internally whether a user is on wp-ms and adjusts accordingly.
 *
 * @return bool
 */
function YMBESEO_allow_system_file_edit()
{
    _deprecated_function(__FUNCTION__, 'WPSEO 1.5.6.1', 'YMBESEO_Utils::allow_system_file_edit()');
    return YMBESEO_Utils::allow_system_file_edit();
}