PATH:
home
/
letacommog
/
lesfinessaveurs
/
wp-content
/
plugins
/
wordpress-seo
/
admin
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin\Export */ /** * Class WPSEO_Export * * Class with functionality to export the WP SEO settings */ class WPSEO_Export { const NONCE_ACTION = 'wpseo_export'; /** * @var string */ private $export = ''; /** * @var string */ private $error = ''; /** * @var boolean */ public $success; /** * Handles the export request. */ public function export() { check_admin_referer( self::NONCE_ACTION ); $this->export_settings(); $this->output(); } /** * Outputs the export. */ public function output() { if ( ! WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) { esc_html_e( 'You do not have the required rights to export settings.', 'wordpress-seo' ); return; } echo '<p>'; /* translators: %1$s expands to Import settings */ printf( esc_html__( 'Copy all these settings to another site\'s %1$s tab and click "%1$s" there.', 'wordpress-seo' ), __( 'Import settings', 'wordpress-seo' ) ); echo '</p>'; echo '<textarea id="wpseo-export" rows="20" cols="100">' . $this->export . '</textarea>'; } /** * Returns true when the property error has a value. * * @return bool */ public function has_error() { return ( $this->error !== '' ); } /** * Sets the error hook, to display the error to the user. */ public function set_error_hook() { /* translators: %1$s expands to Yoast SEO */ $message = sprintf( __( 'Error creating %1$s export: ', 'wordpress-seo' ), 'Yoast SEO' ) . $this->error; printf( '<div class="notice notice-error"><p>%1$s</p></div>', $message ); } /** * Exports the current site's WP SEO settings. */ private function export_settings() { $this->export_header(); foreach ( WPSEO_Options::get_option_names() as $opt_group ) { $this->write_opt_group( $opt_group ); } } /** * Writes the header of the export. */ private function export_header() { $header = sprintf( /* translators: %1$s expands to Yoast SEO, %2$s expands to Yoast.com */ esc_html__( 'These are settings for the %1$s plugin by %2$s', 'wordpress-seo' ), 'Yoast SEO', 'Yoast.com' ); $this->write_line( '; ' . $header ); } /** * Writes a line to the export * * @param string $line Line string. * @param boolean $newline_first Boolean flag whether to prepend with new line. */ private function write_line( $line, $newline_first = false ) { if ( $newline_first ) { $this->export .= PHP_EOL; } $this->export .= $line . PHP_EOL; } /** * Writes an entire option group to the export * * @param string $opt_group Option group name. */ private function write_opt_group( $opt_group ) { $this->write_line( '[' . $opt_group . ']', true ); $options = get_option( $opt_group ); if ( ! is_array( $options ) ) { return; } foreach ( $options as $key => $elem ) { if ( is_array( $elem ) ) { $count = count( $elem ); for ( $i = 0; $i < $count; $i ++ ) { $this->write_setting( $key . '[]', $elem[ $i ] ); } } else { $this->write_setting( $key, $elem ); } } } /** * Writes a settings line to the export * * @param string $key Key string. * @param string $val Value string. */ private function write_setting( $key, $val ) { if ( is_string( $val ) ) { $val = '"' . $val . '"'; } $this->write_line( $key . ' = ' . $val ); } }
[+]
..
[-] class-admin-gutenberg-compatibility-notification.php
[edit]
[-] class-admin-init.php
[edit]
[+]
roles
[+]
metabox
[-] class-yoast-notification.php
[edit]
[-] class-remote-request.php
[edit]
[+]
capabilities
[-] class-admin-user-profile.php
[edit]
[-] class-extension-manager.php
[edit]
[-] class-expose-shortlinks.php
[edit]
[-] class-export.php
[edit]
[+]
ajax
[-] class-help-center.php
[edit]
[+]
notifiers
[-] class-admin-asset-location.php
[edit]
[-] class-admin-utils.php
[edit]
[+]
import
[-] class-paper-presenter.php
[edit]
[+]
config-ui
[-] interface-installable.php
[edit]
[-] class-license-page-manager.php
[edit]
[-] class-admin-recommended-replace-vars.php
[edit]
[-] class-asset.php
[edit]
[+]
pages
[+]
statistics
[+]
menu
[-] class-admin-asset-analysis-worker-location.php
[edit]
[-] class-primary-term-admin.php
[edit]
[-] class-yoast-notification-center.php
[edit]
[-] class-help-center-item.php
[edit]
[-] class-meta-storage.php
[edit]
[-] class-product-upsell-notice.php
[edit]
[+]
google_search_console
[-] class-admin-asset-yoast-components-l10n.php
[edit]
[-] class-yoast-alerts.php
[edit]
[-] class-keyword-synonyms-modal.php
[edit]
[-] interface-collection.php
[edit]
[-] index.php
[edit]
[-] class-yoast-dashboard-widget.php
[edit]
[+]
services
[-] class-admin-editor-specific-replace-vars.php
[edit]
[+]
recalculate
[+]
formatter
[-] class-extension.php
[edit]
[-] class-premium-popup.php
[edit]
[-] class-option-tab.php
[edit]
[+]
views
[-] class-customizer.php
[edit]
[-] class-database-proxy.php
[edit]
[+]
help_center
[-] class-admin-asset-dev-server-location.php
[edit]
[-] class-admin.php
[edit]
[+]
onpage
[+]
tracking
[-] class-yoast-network-settings-api.php
[edit]
[-] class-bulk-editor-list-table.php
[edit]
[+]
endpoints
[-] class-plugin-conflict.php
[edit]
[-] class-option-tabs-formatter.php
[edit]
[-] class-bulk-description-editor-list-table.php
[edit]
[+]
filters
[-] class-premium-upsell-admin-block.php
[edit]
[-] class-extensions.php
[edit]
[-] class-config.php
[edit]
[-] class-multiple-keywords-modal.php
[edit]
[-] class-yoast-form.php
[edit]
[-] class-add-keyword-modal.php
[edit]
[-] class-option-tabs.php
[edit]
[-] class-admin-media-purge-notification.php
[edit]
[+]
taxonomy
[-] class-gutenberg-compatibility.php
[edit]
[-] class-plugin-availability.php
[edit]
[+]
listeners
[-] ajax.php
[edit]
[-] class-plugin-compatibility.php
[edit]
[-] class-collector.php
[edit]
[-] class-bulk-title-editor-list-table.php
[edit]
[-] class-suggested-plugins.php
[edit]
[-] class-admin-asset-manager.php
[edit]
[+]
links
[-] class-meta-table-accessible.php
[edit]
[-] class-meta-columns.php
[edit]
[+]
watchers
[-] class-yoast-columns.php
[edit]
[-] class-social-admin.php
[edit]
[-] class-admin-asset-seo-location.php
[edit]
[-] class-admin-help-panel.php
[edit]
[-] class-recalculate-scores.php
[edit]
[-] class-yoast-network-admin.php
[edit]
[-] class-yoast-plugin-conflict.php
[edit]