/**
  * Import All In One SEO settings
  */
 public function __construct()
 {
     parent::__construct();
     $this->aioseo_options = get_option('aioseop_options');
     $this->import_metas();
     $this->import_ga();
 }
示例#2
0
 /**
  * Import wpSEO settings
  */
 public function __construct()
 {
     parent::__construct();
     $this->import_post_metas();
     $this->import_taxonomy_metas();
     $this->set_msg(__(sprintf('wpSEO data successfully imported. Would you like to %sdisable the wpSEO plugin%s?', '<a href="' . esc_url(admin_url('admin.php?page=wpseo_tools&tool=import-export&deactivate_wpseo=1#top#import-seo')) . '">', '</a>'), 'wordpress-seo'));
 }
 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->import_home();
     $this->import_option('seo_woo_single_layout', 'post');
     $this->import_option('seo_woo_page_layout', 'page');
     $this->import_archive_option();
     $this->import_custom_values('seo_woo_meta_home_desc', 'metadesc-home-wpseo');
     $this->import_custom_values('seo_woo_meta_home_key', 'metakey-home-wpseo');
     $this->import_metas();
     update_option('wpseo_titles', $this->options);
     $this->set_msg(__('WooThemes SEO framework settings &amp; data successfully imported.', 'wordpress-seo'));
 }
 *
 * In case of POST the user is on the Yoast SEO import page and in case of the GET the user sees a notice from
 * Yoast SEO that we can import stuff for that plugin.
 */
if (filter_input(INPUT_POST, 'import') || filter_input(INPUT_GET, 'import')) {
    check_admin_referer('wpseo-import');
    $post_wpseo = filter_input(INPUT_POST, 'wpseo', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
    $replace = !empty($post_wpseo['deleteolddata']) && $post_wpseo['deleteolddata'] === 'on';
    if (!empty($post_wpseo['importwoo'])) {
        $import = new WPSEO_Import_WooThemes_SEO($replace);
    }
    if (!empty($post_wpseo['importaioseo']) || filter_input(INPUT_GET, 'importaioseo')) {
        $import = new WPSEO_Import_AIOSEO($replace);
    }
    if (!empty($post_wpseo['importheadspace'])) {
        $import = new WPSEO_Import_External($replace);
        $import->import_headspace();
    }
    if (!empty($post_wpseo['importwpseo']) || filter_input(INPUT_GET, 'importwpseo')) {
        $import = new WPSEO_Import_WPSEO($replace);
    }
    // Allow custom import actions.
    do_action('wpseo_handle_import');
}
if (isset($_FILES['settings_import_file'])) {
    check_admin_referer('wpseo-import-file');
    $import = new WPSEO_Import();
}
if (isset($import)) {
    /**
     * Allow customization of import&export message
        $import = new WPSEO_Import_AIOSEO($replace);
    }
    if (isset($_POST['wpseo']['importheadspace'])) {
        $import = new WPSEO_Import_External($replace);
        $import->import_headspace();
    }
    if (isset($_POST['wpseo']['importrobotsmeta']) || isset($_GET['importrobotsmeta'])) {
        $import = new WPSEO_Import_External($replace);
        $import->import_robots_meta();
    }
    if (isset($_POST['wpseo']['importrssfooter'])) {
        $import = new WPSEO_Import_External($replace);
        $import->import_rss_footer();
    }
    if (isset($_POST['wpseo']['importbreadcrumbs'])) {
        $import = new WPSEO_Import_External($replace);
        $import->import_yoast_breadcrumbs();
    }
    // Allow custom import actions
    do_action('wpseo_handle_import');
}
if (isset($_FILES['settings_import_file'])) {
    check_admin_referer('wpseo-import-file');
    $import = new WPSEO_Import();
}
if (isset($import)) {
    /**
     * Allow customization of import&export message
     * @api  string  $msg  The message.
     */
    $msg = apply_filters('wpseo_import_message', $import->msg);