PATH:
home
/
letacommog
/
latelier-beaute
/
wp-content
/
plugins
/
wordpress-seo
/
admin
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin */ /** * Class WPSEO_Admin_Pages * * Class with functionality for the Yoast SEO admin pages. */ class WPSEO_Admin_Pages { /** * @var string $currentoption The option in use for the current admin page. */ public $currentoption = 'wpseo'; /** * Holds the asset manager. * * @var WPSEO_Admin_Asset_Manager */ private $asset_manager; /** * Class constructor, which basically only hooks the init function on the init hook */ public function __construct() { add_action( 'init', array( $this, 'init' ), 20 ); $this->asset_manager = new WPSEO_Admin_Asset_Manager(); } /** * Make sure the needed scripts are loaded for admin pages */ public function init() { if ( filter_input( INPUT_GET, 'wpseo_reset_defaults' ) && wp_verify_nonce( filter_input( INPUT_GET, 'nonce' ), 'wpseo_reset_defaults' ) && current_user_can( 'manage_options' ) ) { WPSEO_Options::reset(); wp_redirect( admin_url( 'admin.php?page=' . WPSEO_Configuration_Page::PAGE_IDENTIFIER ) ); } add_action( 'admin_init', array( $this, 'admin_init' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'config_page_scripts' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'config_page_styles' ) ); } /** * Run admin-specific actions. */ public function admin_init() { $page = filter_input( INPUT_GET, 'page' ); $tool = filter_input( INPUT_GET, 'tool' ); $export_nonce = filter_input( INPUT_POST, WPSEO_Export::NONCE_NAME ); if ( 'wpseo_tools' === $page && 'import-export' === $tool && $export_nonce !== null ) { $this->do_yoast_export(); } } /** * Loads the required styles for the config page. */ public function config_page_styles() { wp_enqueue_style( 'dashboard' ); wp_enqueue_style( 'thickbox' ); wp_enqueue_style( 'global' ); wp_enqueue_style( 'wp-admin' ); $this->asset_manager->enqueue_style( 'select2' ); $this->asset_manager->enqueue_style( 'admin-css' ); } /** * Loads the required scripts for the config page. */ public function config_page_scripts() { $this->asset_manager->enqueue_script( 'admin-script' ); $this->asset_manager->enqueue_script( 'help-center' ); $page = filter_input( INPUT_GET, 'page' ); if ( $page === 'wpseo_titles' ) { wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'search-appearance', 'wpseoReplaceVarsL10n', $this->localize_replace_vars_script() ); wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'search-appearance', 'wpseoSearchAppearance', array( 'isRtl' => is_rtl() ) ); $this->asset_manager->enqueue_script( 'search-appearance' ); $this->asset_manager->enqueue_style( 'search-appearance' ); /** * Remove the emoji script as it is incompatible with both React and any * contenteditable fields. */ remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); $yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n(); $yoast_components_l10n->localize_script( 'search-appearance' ); } wp_enqueue_script( 'dashboard' ); wp_enqueue_script( 'thickbox' ); wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'admin-script', 'wpseoSelect2Locale', WPSEO_Utils::get_language( WPSEO_Utils::get_user_locale() ) ); if ( in_array( $page, array( 'wpseo_social', WPSEO_Admin::PAGE_IDENTIFIER, 'wpseo_titles' ), true ) ) { wp_enqueue_media(); $this->asset_manager->enqueue_script( 'admin-media' ); wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'admin-media', 'wpseoMediaL10n', $this->localize_media_script() ); } if ( 'wpseo_tools' === $page ) { $this->enqueue_tools_scripts(); } } /** * Retrieves some variables that are needed for the upload module in JS. * * @return array The upload module variables. */ public function localize_media_script() { return array( 'choose_image' => __( 'Use Image', 'wordpress-seo' ), ); } /** * Retrieves some variables that are needed for replacing variables in JS. * * @return array The replacement and recommended replacement variables. */ public function localize_replace_vars_script() { $replace_vars = new WPSEO_Replace_Vars(); $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars(); $replace_vars_list = $replace_vars->get_replacement_variables_list(); return array( 'replace_vars' => $replace_vars_list, 'recommended_replace_vars' => $recommended_replace_vars->get_recommended_replacevars(), 'editor_specific_replace_vars' => $editor_specific_replace_vars->get(), 'shared_replace_vars' => $editor_specific_replace_vars->get_generic( $replace_vars_list ), ); } /** * Enqueues and handles all the tool dependencies. */ private function enqueue_tools_scripts() { $tool = filter_input( INPUT_GET, 'tool' ); if ( empty( $tool ) ) { $this->asset_manager->enqueue_script( 'yoast-seo' ); } if ( 'bulk-editor' === $tool ) { $this->asset_manager->enqueue_script( 'bulk-editor' ); } } /** * Runs the yoast exporter class to possibly init the file download. */ private function do_yoast_export() { check_admin_referer( WPSEO_Export::NONCE_ACTION, WPSEO_Export::NONCE_NAME ); if ( ! WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) { return; } $wpseo_post = filter_input( INPUT_POST, 'wpseo' ); $include_taxonomy = ! empty( $wpseo_post['include_taxonomy'] ); $export = new WPSEO_Export( $include_taxonomy ); if ( $export->has_error() ) { add_action( 'admin_notices', array( $export, 'set_error_hook' ) ); } } } /* End of class */
[+]
..
[-] class-yoast-network-settings-api.php
[edit]
[-] class-admin-gutenberg-compatibility-notification.php
[edit]
[-] class-meta-storage.php
[edit]
[-] class-yoast-alerts.php
[edit]
[-] class-primary-term-admin.php
[edit]
[-] class-plugin-conflict.php
[edit]
[-] class-plugin-compatibility.php
[edit]
[+]
metabox
[+]
notifiers
[-] class-export.php
[edit]
[-] class-premium-popup.php
[edit]
[+]
config-ui
[+]
watchers
[-] ajax.php
[edit]
[-] class-asset.php
[edit]
[-] class-suggested-plugins.php
[edit]
[-] class-remote-request.php
[edit]
[-] class-premium-upsell-admin-block.php
[edit]
[+]
statistics
[+]
taxonomy
[-] class-add-keyword-modal.php
[edit]
[-] class-help-center-item.php
[edit]
[+]
formatter
[-] interface-collection.php
[edit]
[-] class-product-upsell-notice.php
[edit]
[-] class-admin-asset-manager.php
[edit]
[-] class-yoast-notification.php
[edit]
[-] class-yoast-modal.php
[edit]
[-] class-extension.php
[edit]
[-] class-bulk-editor-list-table.php
[edit]
[-] class-admin-asset-dev-server-location.php
[edit]
[-] class-database-proxy.php
[edit]
[-] class-admin-user-profile.php
[edit]
[-] class-option-tabs.php
[edit]
[-] class-yoast-network-admin.php
[edit]
[-] index.php
[edit]
[+]
links
[+]
onpage
[-] class-yoast-form.php
[edit]
[-] class-admin-asset-analysis-worker-location.php
[edit]
[-] class-extensions.php
[edit]
[+]
help_center
[-] class-bulk-description-editor-list-table.php
[edit]
[-] class-plugin-availability.php
[edit]
[-] class-admin-media-purge-notification.php
[edit]
[+]
tracking
[-] class-help-center.php
[edit]
[-] class-admin-recommended-replace-vars.php
[edit]
[-] class-yoast-notification-center.php
[edit]
[+]
roles
[-] class-admin-help-panel.php
[edit]
[+]
menu
[-] class-admin.php
[edit]
[-] class-yoast-columns.php
[edit]
[+]
services
[-] class-gutenberg-compatibility.php
[edit]
[-] class-admin-asset-seo-location.php
[edit]
[+]
recalculate
[-] interface-installable.php
[edit]
[-] class-config.php
[edit]
[-] class-keyword-synonyms-modal.php
[edit]
[-] class-social-admin.php
[edit]
[-] class-admin-editor-specific-replace-vars.php
[edit]
[-] class-yoast-dashboard-widget.php
[edit]
[+]
endpoints
[-] class-admin-utils.php
[edit]
[-] class-cornerstone.php
[edit]
[-] class-option-tabs-formatter.php
[edit]
[+]
filters
[+]
pages
[-] class-meta-columns.php
[edit]
[-] class-customizer.php
[edit]
[-] class-recalculate-scores.php
[edit]
[-] class-paper-presenter.php
[edit]
[-] class-option-tab.php
[edit]
[+]
google_search_console
[+]
import
[+]
ajax
[+]
capabilities
[-] class-admin-init.php
[edit]
[+]
listeners
[-] class-admin-asset-yoast-components-l10n.php
[edit]
[-] class-yoast-plugin-conflict.php
[edit]
[-] class-extension-manager.php
[edit]
[-] class-expose-shortlinks.php
[edit]
[-] class-admin-asset-location.php
[edit]
[-] class-license-page-manager.php
[edit]
[-] class-bulk-title-editor-list-table.php
[edit]
[+]
views
[-] class-meta-table-accessible.php
[edit]
[-] class-multiple-keywords-modal.php
[edit]
[-] class-collector.php
[edit]