Commit 13466be3 authored by Simon's avatar Simon

in progress

parent d2684603
......@@ -173,16 +173,16 @@ services:
# wp option update date_format "Y-m-d";
# wp option update time_format "H:i";
wp plugin install loco-translate --version=2.3.0 --activate-network --force;
wp plugin install loco-translate --version=2.3.0 --activate-network;
# wp plugin update loco-translate --version=2.3.0;
wp plugin install pods --version=2.7.15 --activate-network --force;
wp plugin install pods --version=2.7.15 --activate-network;
# wp plugin update pods --version=2.7.15;
wp plugin install polylang --version=2.6.4 --activate-network --force;
wp plugin install polylang --version=2.6.4 --activate-network;
# wp plugin update polylang --version=2.6.4;
wp plugin install wordpress-seo --version=12.1 --activate-network --force;
wp plugin install wordpress-seo --version=12.1 --activate-network;
# wp plugin update wordpress-seo --version=12.1;
wp plugin update akismet --version=4.1.2;
......
......@@ -66,26 +66,14 @@ if ( ! defined( 'WPINC' ) ) die;
<form name="form-recommend" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post" enctype="multipart/form-data" class="c-form c-form--recommend">
<div id="action" class="c-form--action"></div>
<?php if (isset($_SESSION['recommend--s']) && $_SESSION['recommend--s'] == 1) : ?>
<div class="c-form--success">
<?php if (isset($_SESSION['recommend--s']) && $_SESSION['recommend--s'] == 1): ?>
<div class="c-form--success c-form--success-recommend">
<?php _e('Thank You for your recommendation!', 'biuro-contacts'); ?>
<br>
<?php _e('Your recommendation was send successfully, we will contact Your friend', 'biuro-contacts'); ?>
</div>
<?php endif; ?>
<?php
if ( isset($_SESSION['recommend--captcha-status']) && $_SESSION['recommend--captcha-status'] == 'error' ):
?>
<div class="c-form--validation-fixed c-form--validation-error">
<?php _e('Sorry, something went wrong. Please try again', 'biuro-contacts'); ?>
</div>
<?php
unset($_SESSION['recommend--captcha-status']);
endif;
?>
<div class="c-form--cols">
<div class="c-form--col c-form--col--about">
......@@ -222,6 +210,18 @@ if ( ! defined( 'WPINC' ) ) die;
</div><!-- .c-form--col -->
</div><!-- .c-form--cols -->
<?php
if ( isset($_SESSION['recommend--captcha-status']) && $_SESSION['recommend--captcha-status'] == 'error' ):
?>
<div class="c-form--validation-fixed c-form--validation-error">
<?php _e('Sorry, something went wrong. Please try again', 'biuro-contacts'); ?>
</div>
<?php
unset($_SESSION['recommend--captcha-status']);
endif;
?>
<div class="c-form--row">
<div class="c-form--label-infobox">
<?php _e('I allow, that my personal data will be used for communicating during the pre-contractual relationship. For more detailed information view our <a href="https://biuro.eu/privacy-en.html" target="_blank" rel="noopener">Personal Data Protection Policy.</a>', 'biuro-contacts'); ?>
......
......@@ -649,16 +649,6 @@ class WPSEO_Admin_Asset_Manager {
'wp-element',
),
),
array(
'name' => 'courses-overview',
'src' => 'wp-seo-courses-overview-' . $flat_version,
'deps' => array(
'wp-element',
'wp-i18n',
self::PREFIX . 'styled-components',
self::PREFIX . 'components',
),
),
);
}
......
......@@ -35,19 +35,22 @@ class WPSEO_Paper_Presenter {
* WPSEO_presenter_paper constructor.
*
* @param string $title The title of the paper.
* @param string $view_file Optional. The path to the view file. Use the content setting if you do not wish to use a view file.
* @param string $view_file Optional. The path to the view file. Use the content setting if you do not wish to use
* a view file.
* @param array $settings Optional. Settings for the paper.
*/
public function __construct( $title, $view_file = null, array $settings = array() ) {
$defaults = array(
'paper_id' => null,
'collapsible' => false,
'expanded' => false,
'help_text' => '',
'title_after' => '',
'class' => '',
'content' => '',
'view_data' => array(),
'paper_id' => null,
'paper_id_prefix' => 'wpseo-',
'collapsible' => false,
'collapsible_header_class' => '',
'expanded' => false,
'help_text' => '',
'title_after' => '',
'class' => '',
'content' => '',
'view_data' => array(),
);
$this->settings = wp_parse_args( $settings, $defaults );
......@@ -91,15 +94,17 @@ class WPSEO_Paper_Presenter {
}
$view_variables = array(
'class' => $this->settings['class'],
'collapsible' => $this->settings['collapsible'],
'collapsible_config' => $this->collapsible_config(),
'title_after' => $this->settings['title_after'],
'help_text' => $this->settings['help_text'],
'view_file' => $this->view_file,
'title' => $this->title,
'paper_id' => $this->settings['paper_id'],
'yform' => Yoast_Form::get_instance(),
'class' => $this->settings['class'],
'collapsible' => $this->settings['collapsible'],
'collapsible_config' => $this->collapsible_config(),
'collapsible_header_class' => $this->settings['collapsible_header_class'],
'title_after' => $this->settings['title_after'],
'help_text' => $this->settings['help_text'],
'view_file' => $this->view_file,
'title' => $this->title,
'paper_id' => $this->settings['paper_id'],
'paper_id_prefix' => $this->settings['paper_id_prefix'],
'yform' => Yoast_Form::get_instance(),
);
return array_merge( $this->settings['view_data'], $view_variables );
......
......@@ -111,24 +111,6 @@ class WPSEO_Plugin_Availability {
),
'version_sync' => false,
),
'yoastseo-amp' => array(
'url' => 'https://wordpress.org/plugins/glue-for-yoast-seo-amp/',
'title' => 'Yoast SEO AMP Glue',
'description' => sprintf(
/* translators: %1$s expands to Yoast SEO */
__( 'Seamlessly integrate %1$s into your AMP pages!', 'wordpress-seo' ),
'Yoast SEO'
),
'installed' => false,
'slug' => 'glue-for-yoast-seo-amp/yoastseo-amp.php',
'_dependencies' => array(
'AMP' => array(
'slug' => 'amp/amp.php',
),
),
'version_sync' => false,
),
);
}
......
......@@ -38,7 +38,6 @@ class WPSEO_Remote_Request {
*/
protected $args = array(
'blocking' => false,
'sslverify' => false,
'timeout' => 2,
);
......
......@@ -134,6 +134,9 @@ class Yoast_Dashboard_Widget implements WPSEO_WordPress_Integration {
'ryte_analyze' => __( 'Analyze entire site', 'wordpress-seo' ),
'ryte_fetch_url' => esc_attr( add_query_arg( 'wpseo-redo-onpage', '1' ) ) . '#wpseo-dashboard-overview',
'ryte_landing_url' => WPSEO_Shortlinker::get( 'https://yoa.st/rytelp' ),
'wp_version' => substr( $GLOBALS['wp_version'], 0, 3 ) . '-' . ( is_plugin_active( 'classic-editor/classic-editor.php' ) ? '1' : '0' ),
// @codingStandardsIgnoreLine
'php_version' => PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, // phpcs:ignore PHPCompatibility.Constants.NewConstants -- Does not work in PHP 5.2.3 and 5.2.4.
);
}
......
......@@ -370,7 +370,15 @@ class Yoast_Form {
'class' => 'textinput',
)
);
echo '<input' . $attributes . ' class="textinput ' . esc_attr( $attr['class'] ) . ' " placeholder="' . esc_attr( $attr['placeholder'] ) . '" type="text" id="', esc_attr( $var ), '" name="', esc_attr( $this->option_name ), '[', esc_attr( $var ), ']" value="', esc_attr( $val ), '"', disabled( $this->is_control_disabled( $var ), true, false ), '/>', '<br class="clear" />';
$has_input_error = Yoast_Input_Validation::yoast_form_control_has_error( $var );
$aria_attributes = Yoast_Input_Validation::get_the_aria_invalid_attribute( $var );
Yoast_Input_Validation::set_error_descriptions();
$aria_attributes .= Yoast_Input_Validation::get_the_aria_describedby_attribute( $var );
echo '<input' . $attributes . $aria_attributes . ' class="textinput ' . esc_attr( $attr['class'] ) . '" placeholder="' . esc_attr( $attr['placeholder'] ) . '" type="text" id="', esc_attr( $var ), '" name="', esc_attr( $this->option_name ), '[', esc_attr( $var ), ']" value="', esc_attr( $val ), '"', disabled( $this->is_control_disabled( $var ), true, false ), '/>', '<br class="clear" />';
echo Yoast_Input_Validation::get_the_error_description( $var );
}
/**
......
......@@ -61,4 +61,226 @@ class Yoast_Input_Validation {
return $admin_title;
}
/**
* Checks whether a specific form input field was submitted with an invalid value.
*
* @since 12.1
*
* @param string $error_code Must be the same slug-name used for the field variable and for `add_settings_error()`.
*
* @return bool Whether or not the submitted input field contained an invalid value.
*/
public static function yoast_form_control_has_error( $error_code ) {
$errors = get_settings_errors();
foreach ( $errors as $error ) {
if ( $error['code'] === $error_code ) {
return true;
}
}
return false;
}
/**
* The error descriptions.
*
* @since 12.1
* @var array
*/
private static $_error_descriptions = array();
/**
* Sets the error descriptions.
*
* @since 12.1
*
* @param array $descriptions An associative array of error descriptions. For
* each entry, the key must be the setting variable.
*/
public static function set_error_descriptions( $descriptions = array() ) {
$defaults = array(
'baiduverify' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Baidu verification codes can only contain letters, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'baiduverify' )
),
'fbadminapp' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'The Facebook App ID you entered doesn\'t exist. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'fbadminapp' )
),
'googleverify' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Google verification codes can only contain letters, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'googleverify' )
),
'msverify' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Bing confirmation codes can only contain letters from A to F, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'msverify' )
),
'pinterestverify' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Pinterest confirmation codes can only contain letters from A to F, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'pinterestverify' )
),
'twitter_site' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Twitter usernames can only contain letters, numbers, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'twitter_site' )
),
'yandexverify' => sprintf(
/* translators: %s: additional message with the submitted invalid value */
esc_html__( 'Yandex confirmation codes can only contain letters from A to F, numbers, hyphens, and underscores. %s', 'wordpress-seo' ),
self::get_dirty_value_message( 'yandexverify' )
),
);
$descriptions = wp_parse_args( $descriptions, $defaults );
self::$_error_descriptions = $descriptions;
}
/**
* Gets all the error descriptions.
*
* @since 12.1
*
* @return array An associative array of error descriptions.
*/
public static function get_error_descriptions() {
return self::$_error_descriptions;
}
/**
* Gets a specific error description.
*
* @since 12.1
*
* @param string $error_code Code of the error set via `add_settings_error()`, normally the variable name.
* @return string The error description.
*/
public static function get_error_description( $error_code ) {
if ( ! isset( self::$_error_descriptions[ $error_code ] ) ) {
return null;
}
return self::$_error_descriptions[ $error_code ];
}
/**
* Gets the aria-invalid HTML attribute based on the submitted invalid value.
*
* @since 12.1
*
* @param string $error_code Code of the error set via `add_settings_error()`, normally the variable name.
* @return string The aria-invalid HTML attribute or empty string.
*/
public static function get_the_aria_invalid_attribute( $error_code ) {
if ( self::yoast_form_control_has_error( $error_code ) ) {
return ' aria-invalid="true"';
}
return '';
}
/**
* Gets the aria-describedby HTML attribute based on the submitted invalid value.
*
* @since 12.1
*
* @param string $error_code Code of the error set via `add_settings_error()`, normally the variable name.
* @return string The aria-describedby HTML attribute or empty string.
*/
public static function get_the_aria_describedby_attribute( $error_code ) {
if ( self::yoast_form_control_has_error( $error_code ) && self::get_error_description( $error_code ) ) {
return ' aria-describedby="' . esc_attr( $error_code ) . '-error-description"';
}
return '';
}
/**
* Gets the error description wrapped in a HTML paragraph.
*
* @since 12.1
*
* @param string $error_code Code of the error set via `add_settings_error()`, normally the variable name.
* @return string The error description HTML or empty string.
*/
public static function get_the_error_description( $error_code ) {
$error_description = self::get_error_description( $error_code );
if ( self::yoast_form_control_has_error( $error_code ) && $error_description ) {
return '<p id="' . esc_attr( $error_code ) . '-error-description" class="yoast-input-validation__error-description">' . $error_description . '</p>';
}
return '';
}
/**
* Adds the submitted invalid value to the WordPress `$wp_settings_errors` global.
*
* @since 12.1
*
* @param string $error_code Code of the error set via `add_settings_error()`, normally the variable name.
* @param string $dirty_value The submitted invalid value.
* @return void
*/
public static function add_dirty_value_to_settings_errors( $error_code, $dirty_value ) {
global $wp_settings_errors;
if ( ! is_array( $wp_settings_errors ) ) {
return;
}
foreach ( $wp_settings_errors as $index => $error ) {
if ( $error['code'] === $error_code ) {
$wp_settings_errors[ $index ]['yoast_dirty_value'] = $dirty_value;
}
}
}
/**
* Gets an invalid submitted value.
*
* @since 12.1
*
* @param string $error_code Code of the error set via `add_settings_error()`, normally the variable name.
* @return string The submitted invalid input field value.
*/
public static function get_dirty_value( $error_code ) {
$errors = get_settings_errors();
foreach ( $errors as $error ) {
if ( $error['code'] === $error_code && isset( $error['yoast_dirty_value'] ) ) {
return $error['yoast_dirty_value'];
}
}
return '';
}
/**
* Gets a specific invalid value message.
*
* @since 12.1
*
* @param string $error_code Code of the error set via `add_settings_error()`, normally the variable name.
* @return string The error invalid value message or empty string.
*/
public static function get_dirty_value_message( $error_code ) {
$dirty_value = self::get_dirty_value( $error_code );
if ( $dirty_value ) {
return sprintf(
__( 'The submitted value was: %s', 'wordpress-seo' ),
$dirty_value
);
}
return '';
}
}
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* This class handles enqueuing the required JS files for the courses overview.
*/
class WPSEO_Courses_Overview implements WPSEO_WordPress_Integration {
/**
* Registers all hooks to WordPress.
*
* @return void
*/
public function register_hooks() {
global $pagenow;
$current_page = filter_input( INPUT_GET, 'page' );
if ( $pagenow === 'admin.php' && $current_page === 'wpseo_courses' ) {
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
}
}
/**
* Enqueue the relevant script.
*
* @return void
*/
public function enqueue_scripts() {
wp_enqueue_script( WPSEO_Admin_Asset_Manager::PREFIX . 'courses-overview' );
$localizations = array(
'isRtl' => is_rtl(),
);
wp_localize_script(
WPSEO_Admin_Asset_Manager::PREFIX . 'courses-overview',
'wpseoCoursesOverviewL10n',
$localizations
);
}
}
......@@ -70,6 +70,7 @@ class WPSEO_Metabox_Formatter {
'isPremium' => WPSEO_Utils::is_yoast_seo_premium(),
'addKeywordUpsell' => $this->get_add_keyword_upsell_translations(),
'wordFormRecognitionActive' => ( WPSEO_Language_Utils::get_language( get_locale() ) === 'en' ),
'siteIconUrl' => get_site_icon_url(),
/**
* Filter to determine if the markers should be enabled or not.
......@@ -115,7 +116,7 @@ class WPSEO_Metabox_Formatter {
__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
'<a href="#yoast-seo-analysis-collapsible-metabox">',
'</a>',
'<strong>' . __( 'Not available', 'wordpress-seo' ) . '</strong>'
'<strong>' . __( 'Focus Keyphrase not set', 'wordpress-seo' ) . '</strong>'
),
'bad' => sprintf(
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
......
......@@ -96,7 +96,6 @@ class WPSEO_Admin_Menu extends WPSEO_Base_Menu {
$this->get_submenu_page( __( 'Social', 'wordpress-seo' ), 'wpseo_social' ),
$this->get_submenu_page( __( 'Tools', 'wordpress-seo' ), 'wpseo_tools' ),
$this->get_submenu_page( $this->get_license_page_title(), 'wpseo_licenses' ),
$this->get_submenu_page( __( 'Courses', 'wordpress-seo' ), 'wpseo_courses' ),
);
/**
......
......@@ -88,10 +88,6 @@ class WPSEO_Menu implements WPSEO_WordPress_Integration {
require_once WPSEO_PATH . 'admin/pages/licenses.php';
break;
case 'wpseo_courses':
require_once WPSEO_PATH . 'admin/pages/courses.php';
break;
case 'wpseo_files':
require_once WPSEO_PATH . 'admin/views/tool-file-editor.php';
break;
......
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
* @since 9.4.0.
*/
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
?>
<div class="wrap yoast">
<h1 id="wpseo-title"><?php echo esc_html( get_admin_page_title() ); ?></h1>
<?php
echo "<div id='yoast-courses-overview'></div>";
?>
</div>
......@@ -4,13 +4,15 @@
*
* @package WPSEO\Admin\Views
*
* @uses string $paper_id The ID of the paper.
* @uses bool $collapsible Whether the collapsible should be rendered.
* @uses array $collapsible_config Configuration for the collapsible.
* @uses string $title The title.
* @uses string $title_after Additional content to render after the title.
* @uses string $view_file Path to the view file.
* @uses WPSEO_Admin_Help_Panel $help_text The help text.
* @uses string $paper_id The ID of the paper.
* @uses string $paper_id_prefix The ID prefix of the paper.
* @uses bool $collapsible Whether the collapsible should be rendered.
* @uses array $collapsible_config Configuration for the collapsible.
* @uses string $collapsible_header_class Class for the collapsible header.
* @uses string $title The title.
* @uses string $title_after Additional content to render after the title.
* @uses string $view_file Path to the view file.
* @uses WPSEO_Admin_Help_Panel $help_text The help text.
*/
if ( ! defined( 'WPSEO_VERSION' ) ) {
......@@ -20,7 +22,8 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
}
?>
<div class="<?php echo esc_attr( 'paper tab-block ' . $class ); ?>"<?php echo ( $paper_id ) ? ' id="' . esc_attr( 'wpseo-' . $paper_id ) . '"' : ''; ?>>
<div
class="<?php echo esc_attr( 'paper tab-block ' . $class ); ?>"<?php echo ( $paper_id ) ? ' id="' . esc_attr( $paper_id_prefix . $paper_id ) . '"' : ''; ?>>
<?php
if ( ! empty( $title ) ) {
......@@ -28,15 +31,16 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
$button_id_attr = '';
if ( ! empty( $paper_id ) ) {
$button_id_attr = sprintf( ' id="%s"', esc_attr( 'wpseo-' . $paper_id . '-button' ) );
$button_id_attr = sprintf( ' id="%s"', esc_attr( $paper_id_prefix . $paper_id . '-button' ) );
}
printf(
'<h2 class="collapsible-header"><button%4$s type="button" class="toggleable-container-trigger" aria-expanded="%3$s">%1$s <span class="toggleable-container-icon dashicons %2$s" aria-hidden="true"></span></button></h2>',
'<h2 class="collapsible-header %5$s"><button%4$s type="button" class="toggleable-container-trigger" aria-expanded="%3$s">%1$s <span class="toggleable-container-icon dashicons %2$s" aria-hidden="true"></span></button></h2>',
esc_html( $title ) . $title_after . $help_text->get_button_html(),
$collapsible_config['toggle_icon'],
$collapsible_config['expanded'],
$button_id_attr
$button_id_attr,
esc_attr( $collapsible_header_class )
);
}
else {
......@@ -50,7 +54,7 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
$container_id_attr = '';
if ( ! empty( $paper_id ) ) {
$container_id_attr = sprintf( ' id="%s"', esc_attr( 'wpseo-' . $paper_id . '-container' ) );
$container_id_attr = sprintf( ' id="%s"', esc_attr( $paper_id_prefix . $paper_id . '-container' ) );
}
printf(
......
......@@ -4,21 +4,26 @@
*
* @package WPSEO\Admin
*
* @uses array $alerts_data
* @uses array $alerts_data
*/
$type = 'alerts';
$type = 'errors';
$dashicon = 'warning';
$active = $alerts_data['errors']['active'];
$dismissed = $alerts_data['errors']['dismissed'];
$active_total = count( $active );
$dismissed_total = count( $dismissed );
$total = $alerts_data['metrics']['errors'];
$i18n_title = __( 'Problems', 'wordpress-seo' );
$i18n_issues = __( 'We have detected the following issues that affect the SEO of your site.', 'wordpress-seo' );
$i18n_no_issues = __( 'Good job! We could detect no serious SEO problems.', 'wordpress-seo' );
$i18n_muted_issues_title = __( 'Muted problems:', 'wordpress-seo' );
$active_total = count( $alerts_data['errors']['active'] );
$total = $alerts_data['metrics']['errors'];
$active = $alerts_data['errors']['active'];
$dismissed = $alerts_data['errors']['dismissed'];
$i18n_muted_issues_title = sprintf(
/* translators: %d expands the amount of hidden problems. */
_n( 'You have %d hidden problem:', 'You have %d hidden problems:', $dismissed_total, 'wordpress-seo' ),
$dismissed_total
);
require WPSEO_PATH . 'admin/views/partial-alerts-template.php';
......@@ -4,16 +4,17 @@
*
* @package WPSEO\Admin
*
* @uses string $type
* @uses string $dashicon
* @uses string $i18n_title
* @uses string $i18n_issues
* @uses string $i18n_no_issues
* @uses string $i18n_muted_issues_title
* @uses int $active_total
* @uses $total
* @uses array $active
* @uses array $dismissed
* @uses string $type
* @uses string $dashicon
* @uses string $i18n_title
* @uses string $i18n_issues
* @uses string $i18n_no_issues
* @uses string $i18n_muted_issues_title
* @uses int $active_total
* @uses int $dismissed_total
* @uses int $total
* @uses array $active
* @uses array $dismissed
*/
if ( ! function_exists( '_yoast_display_alerts' ) ) {
......@@ -22,21 +23,31 @@ if ( ! function_exists( '_yoast_display_alerts' ) ) {
*
* @param array $list List of alerts.
* @param string $status Status of the alerts (active/dismissed).
*
* @return string The output to render.
*/
function _yoast_display_alerts( $list, $status ) {
$alerts = '';
foreach ( $list as $notification ) {
switch ( $status ) {
case 'active':
$button = sprintf( '<button type="button" class="button dismiss"><span class="screen-reader-text">%1$s</span><span class="dashicons dashicons-no-alt"></span></button>', esc_html__( 'Dismiss this item.', 'wordpress-seo' ) );
$button = sprintf(
'<button type="button" class="button dismiss"><span class="screen-reader-text">%1$s</span><span class="dashicons dashicons-hidden"></span></button>',
esc_html__( 'Hide this item.', 'wordpress-seo' )
);
break;
case 'dismissed':
$button = sprintf( '<button type="button" class="button restore"><span class="screen-reader-text">%1$s</span><span class="dashicons dashicons-hidden"></span></button>', esc_html__( 'Restore this item.', 'wordpress-seo' ) );
$button = sprintf(
'<button type="button" class="button restore"><span class="screen-reader-text">%1$s</span><span class="dashicons yoast-svg-icon-eye"></span></button>',
esc_html__( 'Show this item.', 'wordpress-seo' )
);
break;
}
printf(
$alerts .= sprintf(
'<div class="yoast-alert-holder" id="%1$s" data-nonce="%2$s" data-json="%3$s">%4$s%5$s</div>',
esc_attr( $notification->get_id() ),
esc_attr( $notification->get_nonce() ),
......@@ -45,6 +56,8 @@ if ( ! function_exists( '_yoast_display_alerts' ) ) {
$button
);
}
return $alerts;
}
}
......@@ -55,24 +68,37 @@ if ( ! $active ) {
}
?>
<h3><span class="dashicons <?php echo esc_attr( 'dashicons-' . $dashicon ); ?>"></span> <?php echo esc_html( $i18n_title ); ?> (<?php echo (int) $active_total; ?>)</h3>
<h3 class="yoast-alerts-header" id="<?php echo esc_attr( 'yoast-' . $type . '-header' ); ?>">
<span class="dashicons <?php echo esc_attr( 'dashicons-' . $dashicon ); ?>"></span>
<?php echo esc_html( $i18n_title ); ?> (<?php echo (int) $active_total; ?>)
</h3>
<div id="<?php echo esc_attr( 'yoast-' . $type ); ?>">
<?php if ( $total ) : ?>
<p><?php echo esc_html( $wpseo_i18n_summary ); ?></p>
<div class="container" id="<?php echo esc_attr( 'yoast-' . $type . '-active' ); ?>">
<?php _yoast_display_alerts( $active, 'active' ); ?>
<div class="container yoast-alerts-active" id="<?php echo esc_attr( 'yoast-' . $type . '-active' ); ?>">
<?php echo _yoast_display_alerts( $active, 'active' ); ?>
</div>
<?php if ( $dismissed ) : ?>
<h4 class="yoast-muted-title"><?php echo esc_html( $i18n_muted_issues_title ); ?></h4>
<?php endif; ?>
<div class="container" id="<?php echo esc_attr( 'yoast-' . $type . '-dismissed' ); ?>">
<?php _yoast_display_alerts( $dismissed, 'dismissed' ); ?>
</div>
<?php
if ( $dismissed ) {
$dismissed_paper = new WPSEO_Paper_Presenter(
esc_html( $i18n_muted_issues_title ),
null,
array(
'paper_id' => esc_attr( $type . '-dismissed' ),
'paper_id_prefix' => 'yoast-',
'class' => 'yoast-alerts-dismissed',
'content' => _yoast_display_alerts( $dismissed, 'dismissed' ),
'collapsible' => true,
'collapsible_header_class' => 'yoast-alert',
)
);
echo $dismissed_paper->get_output();
}
?>
<?php else : ?>
......
......@@ -4,21 +4,26 @@
*
* @package WPSEO\Admin
*
* @uses array $alerts_data
* @uses array $alerts_data
*/
$type = 'warnings';
$dashicon = 'flag';
$active = $alerts_data['warnings']['active'];
$dismissed = $alerts_data['warnings']['dismissed'];
$active_total = count( $alerts_data['warnings']['active'] );
$dismissed_total = count( $alerts_data['warnings']['dismissed'] );
$total = $alerts_data['metrics']['warnings'];
$i18n_title = __( 'Notifications', 'wordpress-seo' );
$i18n_issues = '';
$i18n_no_issues = __( 'No new notifications.', 'wordpress-seo' );
$i18n_muted_issues_title = __( 'Muted notifications:', 'wordpress-seo' );
$active_total = count( $alerts_data['warnings']['active'] );
$total = $alerts_data['metrics']['warnings'];
$active = $alerts_data['warnings']['active'];
$dismissed = $alerts_data['warnings']['dismissed'];
$i18n_muted_issues_title = sprintf(
/* translators: %d expands the amount of hidden notifications. */
_n( 'You have %d hidden notification:', 'You have %d hidden notifications:', $dismissed_total, 'wordpress-seo' ),
$dismissed_total
);
require WPSEO_PATH . 'admin/views/partial-alerts-template.php';
......@@ -30,7 +30,7 @@ $wpseo_contributors_phrase = sprintf(
<?php echo $notifier->notify(); ?>
<div class="yoast-container yoast-container__alert">
<div class="yoast-container yoast-container__error">
<?php require WPSEO_PATH . 'admin/views/partial-alerts-errors.php'; ?>
</div>
......
<?php
/**
* Yoast SEO Plugin File.
*
* @package Yoast\YoastSEO\PHP_CodeShift
*/
namespace Yoast\WP\Free\PHP_CodeShift;
use PhpParser\Comment\Doc;
use PhpParser\Node;
use PhpParser\Node\Expr\ArrayItem;
use PhpParser\Node\Scalar\String_;
use PhpParser\NodeVisitorAbstract;
/**
* Class Vendor_Prefixing_Visitor
*/
class Remove_Vendor_Prefixing_Array_Key_Visitor extends NodeVisitorAbstract {
/**
* @param \PhpParser\Node $node The node being visited.
*
* @return \PhpParser\Node The possibly modified node.
*/
public function leaveNode( Node $node ) {
if ( ! $node instanceof ArrayItem ) {
return $node;
}
if ( $node->key instanceof String_ && strpos( $node->key->value, YOAST_VENDOR_NS_PREFIX ) !== false ) {
$node->key->value = str_replace( YOAST_VENDOR_NS_PREFIX . '\\', '', $node->key->value );
}
return $node;
}
}
<?php
/**
* Yoast SEO Plugin File.
*
* @package Yoast\YoastSEO\PHP_CodeShift
*/
namespace Yoast\WP\Free\PHP_CodeShift;
use Codeshift\AbstractCodemod;
/**
* Class Vendor_Prefixing_Codemod
*/
class Remove_Vendor_Prefixing_Codemod extends AbstractCodemod {
/**
* Sets up the environment required to do the code modifications.
*/
public function init() {
define( 'YoastSEO_Vendor\RUCKUSING_BASE', __DIR__ . '/../../fake-ruckusing' );
define( 'YOAST_VENDOR_NS_PREFIX', 'YoastSEO_Vendor' );
define( 'YOAST_VENDOR_DEFINE_PREFIX', 'YOASTSEO_VENDOR__' );
define( 'YOAST_VENDOR_PREFIX_DIRECTORY', 'vendor_prefixed' );
$visitor = new Remove_Vendor_Prefixing_Visitor();
$comment_visitor = new Remove_Vendor_Prefixing_Comment_Visitor();
$array_key_visitor = new Remove_Vendor_Prefixing_Array_Key_Visitor();
$this->addTraversalTransform( $visitor, $comment_visitor, $array_key_visitor );
}
}
return 'Yoast\WP\Free\PHP_CodeShift\Remove_Vendor_Prefixing_Codemod';
<?php
/**
* Yoast SEO Plugin File.
*
* @package Yoast\YoastSEO\PHP_CodeShift
*/
namespace Yoast\WP\Free\PHP_CodeShift;
use PhpParser\Comment\Doc;
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
/**
* Class Vendor_Prefixing_Visitor
*/
class Remove_Vendor_Prefixing_Comment_Visitor extends NodeVisitorAbstract {
/**
* @param \PhpParser\Node $node The node being visited.
*
* @return \PhpParser\Node The possibly modified node.
*/
public function leaveNode( Node $node ) {
$comment = $node->getDocComment();
if ( $comment && strpos( $comment->getText(), YOAST_VENDOR_NS_PREFIX ) !== false ) {
$updated_text = str_replace( YOAST_VENDOR_NS_PREFIX . '\\', '', $comment->getText() );
$updated_comment = new Doc( $updated_text, $comment->getLine(), $comment->getFilePos(), $comment->getTokenPos() );
$node->setDocComment( $updated_comment );
}
return $node;
}
}
<?php
/**
* Yoast SEO Plugin File.
*
* @package Yoast\YoastSEO\PHP_CodeShift
*/
namespace Yoast\WP\Free\PHP_CodeShift;
use PhpParser\Node;
use PhpParser\Node\Name;
use PhpParser\NodeVisitorAbstract;
/**
* Class Vendor_Prefixing_Visitor
*/
class Remove_Vendor_Prefixing_Visitor extends NodeVisitorAbstract {
/**
* @param \PhpParser\Node $node The node being visited.
*
* @return \PhpParser\Node The possibly modified node.
*/
public function leaveNode( Node $node ) {
if ( ! $node instanceof Name ) {
return $node;
}
if ( $node->getFirst() !== YOAST_VENDOR_NS_PREFIX ) {
return $node;
}
return $node->slice( 1 );
}
}
......@@ -24,7 +24,7 @@ return array(
'ParameterCircularReferenceException.php', 'ExceptionInterface.php'
] ),
Finder::create()->files()->in( 'vendor/symfony/dependency-injection/ParameterBag' )->name( [
'FrozenParameterBag.php', 'ParameterBagInterface.php', 'EnvPlaceholderParameterBag.php'
'FrozenParameterBag.php', 'ParameterBagInterface.php', 'EnvPlaceholderParameterBag.php', 'ParameterBag.php'
] ),
],
......
......@@ -27,6 +27,30 @@ return array(
*
* For more see: https://github.com/humbug/php-scoper#patchers
*/
'patchers' => [],
'patchers' => [
/**
* Replaces the Adapter string references with the prefixed versions.
*
* @param string $filePath The path of the current file.
* @param string $prefix The prefix to be used.
* @param string $content The content of the specific file.
*
* @return string The modified content.
*/
function( $file_path, $prefix, $content ) {
// 18 is the length of the GrantFactory.php file path.
if ( substr( $file_path, -18 ) !== 'src/Middleware.php' ) {
return $content;
}
$replaced = str_replace(
sprintf( '%s\\\\cookies must be an instance of GuzzleHttp\\\\Cookie\\\\CookieJarInterface', $prefix ),
sprintf( 'cookies must be an instance of %s\\\\GuzzleHttp\\\\Cookie\\\\CookieJarInterface', $prefix ),
$content
);
return $replaced;
},
],
);
......@@ -28,20 +28,10 @@ return array(
'patchers' => array(),
/*
* By default, PHP-Scoper only prefixes code where the namespace is non-global. In other words, non-namespaced
* code is not prefixed. This leaves the majority of classes, functions and constants in PHP - and most extensions,
* untouched.
* By default, PHP-Scoper will not prefix the user defined constants, classes and functions belonging to the global
* namespace. You can however change that setting for them to be prefixed as usual unless explicitly whitelisted.
*
* This is not necessarily a desirable outcome for vendor dependencies which are also not namespaced. To ensure
* they are isolated, you can configure the following which can be a list of strings or callables taking a string
* (the class name) as an argument and return a boolean (true meaning the class is going to prefixed).
*
* For more, see https://github.com/humbug/php-scoper#global-namespace-whitelisting
* https://github.com/humbug/php-scoper#whitelist
*/
'global_namespace_whitelist' => array(
'ORM',
function( $class_name ) {
return strpos( $class_name, 'Idiorm' ) === 0;
},
),
'whitelist-global-classes' => false,
);
......@@ -131,51 +131,15 @@ return array(
return $replaced;
},
/**
* Prefix generally used defines.
*
* @param string $file_path The path of the current file.
* @param string $prefix The prefix to be used.
* @param string $content The content of the specific file.
*
* @return string The modified content.
*/
function( $file_path, $prefix, $content ) {
return str_replace(
array( 'define(\'', 'defined(\'' ),
array(
'define(__NAMESPACE__ . \'\\',
'defined(__NAMESPACE__ . \'\\',
),
$content
);
},
),
/*
* By default, PHP-Scoper only prefixes code where the namespace is non-global. In other words, non-namespaced
* code is not prefixed. This leaves the majority of classes, functions and constants in PHP - and most extensions,
* untouched.
*
* This is not necessarily a desirable outcome for vendor dependencies which are also not namespaced. To ensure
* they are isolated, you can configure the following which can be a list of strings or callables taking a string
* (the class name) as an argument and return a boolean (true meaning the class is going to prefixed).
* By default, PHP-Scoper will not prefix the user defined constants, classes and functions belonging to the global
* namespace. You can however change that setting for them to be prefixed as usual unless explicitly whitelisted.
*
* For more, see https://github.com/humbug/php-scoper#global-namespace-whitelisting
* https://github.com/humbug/php-scoper#whitelist
*/
'global_namespace_whitelist' => array(
/**
* @param string $class_name The class name that is being parsed.
*/
function( $class_name ) {
return strpos( $class_name, 'Ruckusing' ) === 0;
},
/**
* @param string $class_name The class name that is being parsed.
*/
function( $class_name ) {
return strpos( $class_name, 'Task_' ) === 0;
},
),
'whitelist-global-constants' => false,
'whitelist-global-classes' => false,
'whitelist' => [ 'FALSE', 'NULL' ],
);
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;border:0;padding:0;overflow:hidden;word-wrap:normal!important}.yoast-alert{padding:0 12px;border-right:4px solid #fff;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2)}.yoast-alerts .yoast-alert-holder{margin-bottom:.8em}.yoast-alerts .yoast-alert{width:100%}.yoast-container__alert .yoast-alert{border-right-color:#dc3232}#yoast-alerts-dismissed .yoast-alert{border-right-color:#d93f69}.yoast-container__warning .yoast-alert{border-right-color:#5d237a}#yoast-warnings-dismissed .yoast-alert{border-right-color:#0075b3}.yoast-container{position:relative;max-width:1280px;margin:20px 0 1px;padding:20px 20px 0;border:1px solid #e5e5e5;background-color:#fdfdfd;box-shadow:0 1px 1px rgba(0,0,0,.04)}.yoast-alerts>h2:first-child{margin:0;padding:9px 0 4px;font-size:23px;font-weight:400;line-height:29px}.yoast-alerts .yoast-container h3{margin:-20px -20px 0;padding:1em;border-bottom:1px solid #ccc;background-color:#fdfdfd;font-size:1.4em}h3 .dashicons-warning{color:#dc3232}.yoast-container .container{max-width:980px}.yoast-container .yoast-alert-holder{display:-ms-flexbox;display:flex}.dismiss .dashicons,.restore .dashicons{font-size:24px;width:24px;height:24px}.yoast-bottom-spacing{margin-bottom:20px}.yoast-alerts .button.dismiss,.yoast-alerts .button.restore{-ms-flex:0 0 45px;flex:0 0 45px;width:45px;height:45px;margin-right:10px;line-height:inherit;padding:0;outline:none;cursor:pointer}.yoast-alerts .button.dismiss:focus,.yoast-alerts .button.dismiss:hover,.yoast-alerts .button.restore:focus,.yoast-alerts .button.restore:hover{background:transparent}.yoast-container .separator{margin-top:1em;margin-bottom:1em;border-top:1px solid #ddd}.yoast-container .dashicons-yes{color:#77b227}.yoast-container__warning .dashicons-flag{color:#5d237a}.yoast-container-disabled{display:table-cell;position:absolute;top:0;left:0;bottom:0;right:0;border-radius:4px;background-color:hsla(0,0%,91%,.7)}.yoast-no-issues{padding:1em 16px 1em 1em;color:#666}.yoast-muted-title{overflow:hidden;font-weight:600;font-style:italic}.yoast-muted-title:after{content:"";display:inline-block;height:.5em;vertical-align:bottom;width:100%;margin-left:-100%;margin-right:10px;border-top:1px solid #ddd}.yoast-alerts .yoast-container__configuration-wizard{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-shadow:0 1px 2px rgba(0,0,0,.2);background-color:#fff;min-height:0;padding-bottom:20px;margin-bottom:15px}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard img{display:none}}.yoast-alerts .yoast-container__configuration-wizard--content{-ms-flex:1 1 auto;flex:1 1 auto;margin:12px;padding:0}.yoast-alerts .yoast-container__configuration-wizard--content h3{border-bottom:0;font-size:1.4em;line-height:1;margin:0 0 4px;padding:0;background:transparent}.yoast-alerts .yoast-container__configuration-wizard--content p{margin:1em 0 0}.yoast-alerts .yoast-container__configuration-wizard--content p:last-child{margin:0}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--content{display:block;position:relative;padding:16px}}.yoast-alerts .yoast-container__configuration-wizard--dismiss{text-align:center}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--dismiss{width:40px;position:absolute;top:5px;left:5px;margin:0}}.yoast-alerts .yoast-container__configuration-wizard--dismiss .dashicons{text-decoration:none;margin-top:11px}
\ No newline at end of file
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;border:0;padding:0;overflow:hidden;word-wrap:normal!important}.yoast-alert{padding:0 12px;border-left:4px solid #fff;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2)}.yoast-alerts .yoast-alert-holder{margin-bottom:.8em}.yoast-alerts .yoast-alert{width:100%}.yoast-container__alert .yoast-alert{border-left-color:#dc3232}#yoast-alerts-dismissed .yoast-alert{border-left-color:#d93f69}.yoast-container__warning .yoast-alert{border-left-color:#5d237a}#yoast-warnings-dismissed .yoast-alert{border-left-color:#0075b3}.yoast-container{position:relative;max-width:1280px;margin:20px 0 1px;padding:20px 20px 0;border:1px solid #e5e5e5;background-color:#fdfdfd;box-shadow:0 1px 1px rgba(0,0,0,.04)}.yoast-alerts>h2:first-child{margin:0;padding:9px 0 4px;font-size:23px;font-weight:400;line-height:29px}.yoast-alerts .yoast-container h3{margin:-20px -20px 0;padding:1em;border-bottom:1px solid #ccc;background-color:#fdfdfd;font-size:1.4em}h3 .dashicons-warning{color:#dc3232}.yoast-container .container{max-width:980px}.yoast-container .yoast-alert-holder{display:-ms-flexbox;display:flex}.dismiss .dashicons,.restore .dashicons{font-size:24px;width:24px;height:24px}.yoast-bottom-spacing{margin-bottom:20px}.yoast-alerts .button.dismiss,.yoast-alerts .button.restore{-ms-flex:0 0 45px;flex:0 0 45px;width:45px;height:45px;margin-left:10px;line-height:inherit;padding:0;outline:none;cursor:pointer}.yoast-alerts .button.dismiss:focus,.yoast-alerts .button.dismiss:hover,.yoast-alerts .button.restore:focus,.yoast-alerts .button.restore:hover{background:transparent}.yoast-container .separator{margin-top:1em;margin-bottom:1em;border-top:1px solid #ddd}.yoast-container .dashicons-yes{color:#77b227}.yoast-container__warning .dashicons-flag{color:#5d237a}.yoast-container-disabled{display:table-cell;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:4px;background-color:hsla(0,0%,91%,.7)}.yoast-no-issues{padding:1em 1em 1em 16px;color:#666}.yoast-muted-title{overflow:hidden;font-weight:600;font-style:italic}.yoast-muted-title:after{content:"";display:inline-block;height:.5em;vertical-align:bottom;width:100%;margin-right:-100%;margin-left:10px;border-top:1px solid #ddd}.yoast-alerts .yoast-container__configuration-wizard{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-shadow:0 1px 2px rgba(0,0,0,.2);background-color:#fff;min-height:0;padding-bottom:20px;margin-bottom:15px}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard img{display:none}}.yoast-alerts .yoast-container__configuration-wizard--content{-ms-flex:1 1 auto;flex:1 1 auto;margin:12px;padding:0}.yoast-alerts .yoast-container__configuration-wizard--content h3{border-bottom:0;font-size:1.4em;line-height:1;margin:0 0 4px;padding:0;background:transparent}.yoast-alerts .yoast-container__configuration-wizard--content p{margin:1em 0 0}.yoast-alerts .yoast-container__configuration-wizard--content p:last-child{margin:0}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--content{display:block;position:relative;padding:16px}}.yoast-alerts .yoast-container__configuration-wizard--dismiss{text-align:center}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--dismiss{width:40px;position:absolute;top:5px;right:5px;margin:0}}.yoast-alerts .yoast-container__configuration-wizard--dismiss .dashicons{text-decoration:none;margin-top:11px}
\ No newline at end of file
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;border:0;padding:0;overflow:hidden;word-wrap:normal!important}.yoast-alert{padding:0 12px;border-right:4px solid #fff;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2)}.yoast-container{position:relative;max-width:1280px;margin:20px 0 1px;padding:20px 20px 0;border:1px solid #e5e5e5;background-color:#fdfdfd;box-shadow:0 1px 1px rgba(0,0,0,.04)}.yoast-alerts>h2:first-child{margin:0;padding:9px 0 4px;font-size:23px;font-weight:400;line-height:29px}.yoast-alerts .yoast-container h3{margin:-20px -20px 0;padding:1em;border-bottom:1px solid #ccc;background-color:#fdfdfd;font-size:1.4em}.yoast-container .container{max-width:980px}.yoast-container .yoast-alert-holder{display:-ms-flexbox;display:flex;position:relative}.dismiss .dashicons,.restore .dashicons{font-size:20px;width:20px;height:20px}.yoast-bottom-spacing{margin-bottom:20px}.yoast-alerts .button.dismiss,.yoast-alerts .button.restore{position:absolute;left:0;width:52px;height:100%;line-height:inherit;padding:0;outline:none;cursor:pointer;background:transparent;border:none;box-shadow:none;border-radius:0}.yoast-alerts .button.dismiss:focus,.yoast-alerts .button.dismiss:hover,.yoast-alerts .button.restore:focus,.yoast-alerts .button.restore:hover{background:transparent}.yoast-container .separator{margin-top:1em;margin-bottom:1em;border-top:1px solid #ddd}.yoast-container .dashicons-yes{color:#77b227}.yoast-container-disabled{display:table-cell;position:absolute;top:0;left:0;bottom:0;right:0;border-radius:4px;background-color:hsla(0,0%,91%,.7)}.yoast-no-issues{padding:1em 16px 1em 1em;color:#666}.yoast-muted-title{overflow:hidden;font-weight:600;font-style:italic}.yoast-muted-title:after{content:"";display:inline-block;height:.5em;vertical-align:bottom;width:100%;margin-left:-100%;margin-right:10px;border-top:1px solid #ddd}.yoast-alerts-active .yoast-alert,.yoast-alerts-dismissed .yoast-alert{padding-left:52px;-ms-flex:1;flex:1}.yoast-alerts-active .yoast-alert-holder{margin-bottom:20px}.yoast-alerts-dismissed.paper.tab-block{margin:20px 0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container{padding:0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd){background-color:#f7f7f7}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd) .yoast-alert{background-color:transparent}.yoast-alerts-dismissed .yoast-svg-icon-eye{background:transparent url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%20role%3D%22img%22%20aria%2Dhidden%3D%22true%22%20focusable%3D%22false%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1664%20960q%2D152%2D236%2D381%2D353%2061%20104%2061%20225%200%20185%2D131%2E5%20316%2E5t%2D316%2E5%20131%2E5%2D316%2E5%2D131%2E5%2D131%2E5%2D316%2E5q0%2D121%2061%2D225%2D229%20117%2D381%20353%20133%20205%20333%2E5%20326%2E5t434%2E5%20121%2E5%20434%2E5%2D121%2E5%20333%2E5%2D326%2E5zm%2D720%2D384q0%2D20%2D14%2D34t%2D34%2D14q%2D125%200%2D214%2E5%2089%2E5t%2D89%2E5%20214%2E5q0%2020%2014%2034t34%2014%2034%2D14%2014%2D34q0%2D86%2061%2D147t147%2D61q20%200%2034%2D14t14%2D34zm848%20384q0%2034%2D20%2069%2D140%20230%2D376%2E5%20368%2E5t%2D499%2E5%20138%2E5%2D499%2E5%2D139%2D376%2E5%2D368q%2D20%2D35%2D20%2D69t20%2D69q140%2D229%20376%2E5%2D368t499%2E5%2D139%20499%2E5%20139%20376%2E5%20368q20%2035%2020%2069z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 100% 0;background-size:20px}#yoast-errors-header .dashicons{color:#dc3232}#yoast-errors-active .yoast-alert{border-right-color:#dc3232}#yoast-errors-dismissed .yoast-alert{border-right-color:#d93f69}#yoast-warnings-header .dashicons{color:#5d237a}#yoast-warnings-active .yoast-alert{border-right-color:#5d237a}#yoast-warnings-dismissed .yoast-alert{border-right-color:#0075b3}.yoast-alerts .yoast-container__configuration-wizard{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-shadow:0 1px 2px rgba(0,0,0,.2);background-color:#fff;min-height:0;padding-bottom:20px;margin-bottom:15px}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard img{display:none}}.yoast-alerts .yoast-container__configuration-wizard--content{-ms-flex:1 1 auto;flex:1 1 auto;margin:12px;padding:0}.yoast-alerts .yoast-container__configuration-wizard--content h3{border-bottom:0;font-size:1.4em;line-height:1;margin:0 0 4px;padding:0;background:transparent}.yoast-alerts .yoast-container__configuration-wizard--content p{margin:1em 0 0}.yoast-alerts .yoast-container__configuration-wizard--content p:last-child{margin:0}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--content{display:block;position:relative;padding:16px}}.yoast-alerts .yoast-container__configuration-wizard--dismiss{text-align:center}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--dismiss{width:40px;position:absolute;top:5px;left:5px;margin:0}}.yoast-alerts .yoast-container__configuration-wizard--dismiss .dashicons{text-decoration:none;margin-top:11px}
\ No newline at end of file
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;border:0;padding:0;overflow:hidden;word-wrap:normal!important}.yoast-alert{padding:0 12px;border-left:4px solid #fff;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2)}.yoast-container{position:relative;max-width:1280px;margin:20px 0 1px;padding:20px 20px 0;border:1px solid #e5e5e5;background-color:#fdfdfd;box-shadow:0 1px 1px rgba(0,0,0,.04)}.yoast-alerts>h2:first-child{margin:0;padding:9px 0 4px;font-size:23px;font-weight:400;line-height:29px}.yoast-alerts .yoast-container h3{margin:-20px -20px 0;padding:1em;border-bottom:1px solid #ccc;background-color:#fdfdfd;font-size:1.4em}.yoast-container .container{max-width:980px}.yoast-container .yoast-alert-holder{display:-ms-flexbox;display:flex;position:relative}.dismiss .dashicons,.restore .dashicons{font-size:20px;width:20px;height:20px}.yoast-bottom-spacing{margin-bottom:20px}.yoast-alerts .button.dismiss,.yoast-alerts .button.restore{position:absolute;right:0;width:52px;height:100%;line-height:inherit;padding:0;outline:none;cursor:pointer;background:transparent;border:none;box-shadow:none;border-radius:0}.yoast-alerts .button.dismiss:focus,.yoast-alerts .button.dismiss:hover,.yoast-alerts .button.restore:focus,.yoast-alerts .button.restore:hover{background:transparent}.yoast-container .separator{margin-top:1em;margin-bottom:1em;border-top:1px solid #ddd}.yoast-container .dashicons-yes{color:#77b227}.yoast-container-disabled{display:table-cell;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:4px;background-color:hsla(0,0%,91%,.7)}.yoast-no-issues{padding:1em 1em 1em 16px;color:#666}.yoast-muted-title{overflow:hidden;font-weight:600;font-style:italic}.yoast-muted-title:after{content:"";display:inline-block;height:.5em;vertical-align:bottom;width:100%;margin-right:-100%;margin-left:10px;border-top:1px solid #ddd}.yoast-alerts-active .yoast-alert,.yoast-alerts-dismissed .yoast-alert{padding-right:52px;-ms-flex:1;flex:1}.yoast-alerts-active .yoast-alert-holder{margin-bottom:20px}.yoast-alerts-dismissed.paper.tab-block{margin:20px 0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container{padding:0}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd){background-color:#f7f7f7}.yoast-alerts-dismissed.paper.tab-block .paper-container.toggleable-container .yoast-alert-holder:nth-child(odd) .yoast-alert{background-color:transparent}.yoast-alerts-dismissed .yoast-svg-icon-eye{background:transparent url("data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%20role%3D%22img%22%20aria%2Dhidden%3D%22true%22%20focusable%3D%22false%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M1664%20960q%2D152%2D236%2D381%2D353%2061%20104%2061%20225%200%20185%2D131%2E5%20316%2E5t%2D316%2E5%20131%2E5%2D316%2E5%2D131%2E5%2D131%2E5%2D316%2E5q0%2D121%2061%2D225%2D229%20117%2D381%20353%20133%20205%20333%2E5%20326%2E5t434%2E5%20121%2E5%20434%2E5%2D121%2E5%20333%2E5%2D326%2E5zm%2D720%2D384q0%2D20%2D14%2D34t%2D34%2D14q%2D125%200%2D214%2E5%2089%2E5t%2D89%2E5%20214%2E5q0%2020%2014%2034t34%2014%2034%2D14%2014%2D34q0%2D86%2061%2D147t147%2D61q20%200%2034%2D14t14%2D34zm848%20384q0%2034%2D20%2069%2D140%20230%2D376%2E5%20368%2E5t%2D499%2E5%20138%2E5%2D499%2E5%2D139%2D376%2E5%2D368q%2D20%2D35%2D20%2D69t20%2D69q140%2D229%20376%2E5%2D368t499%2E5%2D139%20499%2E5%20139%20376%2E5%20368q20%2035%2020%2069z%22%20%2F%3E%3C%2Fsvg%3E") no-repeat 0 0;background-size:20px}#yoast-errors-header .dashicons{color:#dc3232}#yoast-errors-active .yoast-alert{border-left-color:#dc3232}#yoast-errors-dismissed .yoast-alert{border-left-color:#d93f69}#yoast-warnings-header .dashicons{color:#5d237a}#yoast-warnings-active .yoast-alert{border-left-color:#5d237a}#yoast-warnings-dismissed .yoast-alert{border-left-color:#0075b3}.yoast-alerts .yoast-container__configuration-wizard{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-shadow:0 1px 2px rgba(0,0,0,.2);background-color:#fff;min-height:0;padding-bottom:20px;margin-bottom:15px}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard img{display:none}}.yoast-alerts .yoast-container__configuration-wizard--content{-ms-flex:1 1 auto;flex:1 1 auto;margin:12px;padding:0}.yoast-alerts .yoast-container__configuration-wizard--content h3{border-bottom:0;font-size:1.4em;line-height:1;margin:0 0 4px;padding:0;background:transparent}.yoast-alerts .yoast-container__configuration-wizard--content p{margin:1em 0 0}.yoast-alerts .yoast-container__configuration-wizard--content p:last-child{margin:0}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--content{display:block;position:relative;padding:16px}}.yoast-alerts .yoast-container__configuration-wizard--dismiss{text-align:center}@media screen and (max-width:768px){.yoast-alerts .yoast-container__configuration-wizard--dismiss{width:40px;position:absolute;top:5px;right:5px;margin:0}}.yoast-alerts .yoast-container__configuration-wizard--dismiss .dashicons{text-decoration:none;margin-top:11px}
\ No newline at end of file
.schema-faq-section,.schema-how-to-step{position:relative;padding:8px 32px 8px 4px;margin:4px 0;border:1px solid rgba(145,151,162,.25);list-style-type:none}.schema-faq-buttons,.schema-how-to-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.schema-faq-buttons button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover,.schema-how-to-buttons button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-faq-section-mover,.schema-how-to-step-mover{display:inline-block}.schema-faq-section-mover .editor-block-mover__control,.schema-how-to-step-mover .editor-block-mover__control{display:-ms-inline-flexbox;display:inline-flex;width:36px;height:36px}.schema-faq-question,.schema-how-to-step-name{font-weight:600}.schema-faq-answer,.schema-faq-question,.schema-how-to-description,.schema-how-to-step-name,.schema-how-to-step-text{line-height:inherit}.schema-faq-section-button-container,.schema-how-to-step-button-container{display:-ms-inline-flexbox;display:inline-flex;text-align:left}.schema-faq-section-button-container button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover,.schema-how-to-step-button-container button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-faq-section-controls-container,.schema-how-to-step-controls-container{text-align:left;margin-right:-28px}.schema-faq-section-controls-container .dashicons-arrow-up-alt2,.schema-how-to-step-controls-container .dashicons-arrow-up-alt2{position:relative;top:-1px}.faq-section-add-media .dashicon,.how-to-step-add-media .dashicon,.schema-faq-add-question .dashicon,.schema-how-to-add-step .dashicon,.schema-how-to-duration-button .dashicon{margin-left:4px}.schema-how-to{padding-top:4px}.schema-how-to-step-number{position:absolute;right:4px;width:24px;text-align:left}.schema-how-to-duration-flex-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.schema-how-to-duration-time-input{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap}legend.schema-how-to-duration-legend{margin-left:4px}#schema-how-to-duration-days{margin-left:8px}.schema-how-to-duration .schema-how-to-duration-input[type=number]{width:40px;margin:0 2px;padding:6px 4px;text-align:center;-moz-appearance:textfield}.schema-how-to-duration .schema-how-to-duration-input[type=number]::-webkit-inner-spin-button,.schema-how-to-duration .schema-how-to-duration-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.schema-how-to-duration-button.components-icon-button{margin-right:-8px;vertical-align:top}.schema-how-to-duration-button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-how-to-description{margin:8px 0}
\ No newline at end of file
.schema-faq-section,.schema-how-to-step{position:relative;padding:8px 4px 8px 32px;margin:4px 0;border:1px solid rgba(145,151,162,.25);list-style-type:none}.schema-faq-buttons,.schema-how-to-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.schema-faq-buttons button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover,.schema-how-to-buttons button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-faq-section-mover,.schema-how-to-step-mover{display:inline-block}.schema-faq-section-mover .editor-block-mover__control,.schema-how-to-step-mover .editor-block-mover__control{display:-ms-inline-flexbox;display:inline-flex;width:36px;height:36px}.schema-faq-question,.schema-how-to-step-name{font-weight:600}.schema-faq-answer,.schema-faq-question,.schema-how-to-description,.schema-how-to-step-name,.schema-how-to-step-text{line-height:inherit}.schema-faq-section-button-container,.schema-how-to-step-button-container{display:-ms-inline-flexbox;display:inline-flex;text-align:right}.schema-faq-section-button-container button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover,.schema-how-to-step-button-container button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-faq-section-controls-container,.schema-how-to-step-controls-container{text-align:right;margin-left:-28px}.schema-faq-section-controls-container .dashicons-arrow-up-alt2,.schema-how-to-step-controls-container .dashicons-arrow-up-alt2{position:relative;top:-1px}.faq-section-add-media .dashicon,.how-to-step-add-media .dashicon,.schema-faq-add-question .dashicon,.schema-how-to-add-step .dashicon,.schema-how-to-duration-button .dashicon{margin-right:4px}.schema-how-to{padding-top:4px}.schema-how-to-step-number{position:absolute;left:4px;width:24px;text-align:right}.schema-how-to-duration-flex-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.schema-how-to-duration-time-input{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap}legend.schema-how-to-duration-legend{margin-right:4px}#schema-how-to-duration-days{margin-right:8px}.schema-how-to-duration .schema-how-to-duration-input[type=number]{width:40px;margin:0 2px;padding:6px 4px;text-align:center;-moz-appearance:textfield}.schema-how-to-duration .schema-how-to-duration-input[type=number]::-webkit-inner-spin-button,.schema-how-to-duration .schema-how-to-duration-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.schema-how-to-duration-button.components-icon-button{margin-left:-8px;vertical-align:top}.schema-how-to-duration-button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-how-to-description{margin:8px 0}
\ No newline at end of file
.schema-faq-section,.schema-how-to-step{position:relative;padding:8px 32px 8px 4px;margin:4px 0;border:1px solid rgba(145,151,162,.25);list-style-type:none}.schema-faq-buttons,.schema-how-to-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.schema-faq-buttons button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover,.schema-how-to-buttons button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-faq-section-mover,.schema-how-to-step-mover{display:inline-block}.schema-faq-section-mover .editor-block-mover__control,.schema-how-to-step-mover .editor-block-mover__control{display:-ms-inline-flexbox;display:inline-flex;width:36px;height:36px}.schema-faq-question,.schema-how-to-step-name{font-weight:600}.schema-faq .schema-faq-answer,.schema-faq .schema-faq-question,.schema-how-to .schema-how-to-description,.schema-how-to .schema-how-to-step-name,.schema-how-to .schema-how-to-step-text,.schema-how-to .schema-how-to-steps{margin:0;line-height:inherit}.schema-how-to .schema-how-to-steps{padding-top:0}.schema-faq-section-button-container,.schema-how-to-step-button-container{display:-ms-inline-flexbox;display:inline-flex;text-align:left}.schema-faq-section-button-container button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover,.schema-how-to-step-button-container button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-faq-section-controls-container,.schema-how-to-step-controls-container{text-align:left;margin-right:-28px}.schema-faq-section-controls-container .dashicons-arrow-up-alt2,.schema-how-to-step-controls-container .dashicons-arrow-up-alt2{position:relative;top:-1px}.faq-section-add-media .dashicon,.how-to-step-add-media .dashicon,.schema-faq-add-question .dashicon,.schema-how-to-add-step .dashicon,.schema-how-to-duration-button .dashicon{margin-left:4px}.schema-how-to{padding-top:4px}.schema-how-to-step-number{position:absolute;right:4px;width:24px;text-align:left}.schema-how-to-duration-flex-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.schema-how-to-duration-time-input{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap}legend.schema-how-to-duration-legend{margin-left:4px}#schema-how-to-duration-days{margin-left:8px}.schema-how-to-duration .schema-how-to-duration-input[type=number]{width:40px;margin:0 2px;padding:6px 4px;text-align:center;-moz-appearance:textfield}.schema-how-to-duration .schema-how-to-duration-input[type=number]::-webkit-inner-spin-button,.schema-how-to-duration .schema-how-to-duration-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.schema-how-to-duration-button.components-icon-button{margin-right:-8px;vertical-align:top}.schema-how-to-duration-button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-how-to-description{margin:8px 0}
\ No newline at end of file
.schema-faq-section,.schema-how-to-step{position:relative;padding:8px 4px 8px 32px;margin:4px 0;border:1px solid rgba(145,151,162,.25);list-style-type:none}.schema-faq-buttons,.schema-how-to-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.schema-faq-buttons button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover,.schema-how-to-buttons button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-faq-section-mover,.schema-how-to-step-mover{display:inline-block}.schema-faq-section-mover .editor-block-mover__control,.schema-how-to-step-mover .editor-block-mover__control{display:-ms-inline-flexbox;display:inline-flex;width:36px;height:36px}.schema-faq-question,.schema-how-to-step-name{font-weight:600}.schema-faq .schema-faq-answer,.schema-faq .schema-faq-question,.schema-how-to .schema-how-to-description,.schema-how-to .schema-how-to-step-name,.schema-how-to .schema-how-to-step-text,.schema-how-to .schema-how-to-steps{margin:0;line-height:inherit}.schema-how-to .schema-how-to-steps{padding-top:0}.schema-faq-section-button-container,.schema-how-to-step-button-container{display:-ms-inline-flexbox;display:inline-flex;text-align:right}.schema-faq-section-button-container button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover,.schema-how-to-step-button-container button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-faq-section-controls-container,.schema-how-to-step-controls-container{text-align:right;margin-left:-28px}.schema-faq-section-controls-container .dashicons-arrow-up-alt2,.schema-how-to-step-controls-container .dashicons-arrow-up-alt2{position:relative;top:-1px}.faq-section-add-media .dashicon,.how-to-step-add-media .dashicon,.schema-faq-add-question .dashicon,.schema-how-to-add-step .dashicon,.schema-how-to-duration-button .dashicon{margin-right:4px}.schema-how-to{padding-top:4px}.schema-how-to-step-number{position:absolute;left:4px;width:24px;text-align:right}.schema-how-to-duration-flex-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.schema-how-to-duration-time-input{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap}legend.schema-how-to-duration-legend{margin-right:4px}#schema-how-to-duration-days{margin-right:8px}.schema-how-to-duration .schema-how-to-duration-input[type=number]{width:40px;margin:0 2px;padding:6px 4px;text-align:center;-moz-appearance:textfield}.schema-how-to-duration .schema-how-to-duration-input[type=number]::-webkit-inner-spin-button,.schema-how-to-duration .schema-how-to-duration-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.schema-how-to-duration-button.components-icon-button{margin-left:-8px;vertical-align:top}.schema-how-to-duration-button.components-icon-button:not(:disabled):not([aria-disabled=true]):not(.is-default):hover{box-shadow:none;color:#007cba}.schema-how-to-description{margin:8px 0}
\ No newline at end of file
......@@ -687,11 +687,11 @@ class WPSEO_Frontend {
}
/**
* Output the meta robots value.
* Retrieves the meta robots value.
*
* @return string
*/
public function robots() {
public function get_robots() {
global $wp_query, $post;
$robots = array();
......@@ -784,6 +784,17 @@ class WPSEO_Frontend {
*/
$robotsstr = apply_filters( 'wpseo_robots', $robotsstr );
return $robotsstr;
}
/**
* Outputs the meta robots value.
*
* @return string
*/
public function robots() {
$robotsstr = $this->get_robots();
if ( is_string( $robotsstr ) && $robotsstr !== '' ) {
echo '<meta name="robots" content="', esc_attr( $robotsstr ), '"/>', "\n";
}
......
......@@ -180,14 +180,29 @@ class WPSEO_Schema_Context {
switch ( $this->site_represents ) {
case 'company':
$this->company_name = WPSEO_Options::get( 'company_name' );
$company_name = WPSEO_Options::get( 'company_name' );
/**
* Filter: 'wpseo_schema_company_name' - Allows filtering company name
*
* @api string $company_name.
*/
$this->company_name = apply_filters( 'wpseo_schema_company_name', $company_name );
// Do not use a non-named company.
if ( empty( $this->company_name ) ) {
$this->site_represents = false;
break;
}
$this->company_logo_id = WPSEO_Image_Utils::get_attachment_id_from_settings( 'company_logo' );
$company_logo_id = WPSEO_Image_Utils::get_attachment_id_from_settings( 'company_logo' );
/**
* Filter: 'wpseo_schema_company_logo_id' - Allows filtering company logo id
*
* @api integer $company_logo_id.
*/
$this->company_logo_id = apply_filters( 'wpseo_schema_company_logo_id', $company_logo_id );
/*
* Do not use a company without a logo.
......
......@@ -101,6 +101,14 @@ class WPSEO_Schema_Organization implements WPSEO_Graph_Piece {
$profiles[] = 'https://twitter.com/' . WPSEO_Options::get( 'twitter_site' );
}
/**
* Filter: 'wpseo_schema_organization_social_profiles' - Allows filtering social profiles for the
* represented organization.
*
* @api string[] $profiles
*/
$profiles = apply_filters( 'wpseo_schema_organization_social_profiles', $profiles );
return $profiles;
}
}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500" role="img" aria-hidden="true" focusable="false"><path fill="#7EADB9" d="M500 450H60c-33.1 0-60-26.9-60-60V60C0 26.9 26.9 0 60 0h380c33.1 0 60 26.9 60 60v390z"/><path fill="#7E9358" d="M390.5 218.1c-61.2 113.7-192.3 48.1-279.8-21.9C76.5 169.6 29 209.2 0 245.8V390c0 33.1 26.9 60 60 60h440V132.9c-44.1-5.3-93.2 56.6-109.5 85.2z"/><path fill="#F6A446" d="M390.5 218.1c1.3-2.2 2.6-4.5 3.9-6.8 2.5-10.3 3.9-19.7 3.9-27.6 0-81.9-66.4-148.3-148.3-148.3s-148.3 66.4-148.3 148.3c0 2.3.1 4.7.4 7.2 3 1.3 5.9 3.1 8.7 5.3 87.3 70 218.5 135.6 279.7 21.9z"/><path fill="#EB7D29" d="M390.5 218.1c-61.2 113.7-192.3 48.1-279.8-21.9-2.8-2.2-5.7-3.9-8.7-5.3 5.6 62.3 78.5 190.6 119.8 259 16.6 27.5 28.2 45.4 28.2 45.4s11.5-17.9 28.2-45.4c37.3-61.7 100.1-171.9 116.3-238.7-1.4 2.4-2.7 4.7-4 6.9z"/><path fill="#FFF" d="M287.5 91.9l-44.1 122.5-21-65.9h-32.2l35.5 91.2c3 7.7 3 16.1 0 23.8-3.3 8.5-8.8 17.6-24.1 20.4l-2.5.5v27.5l3.2-.1c14.3-.6 25.4-5.3 34.9-14.9 9.5-9.6 17.6-24.3 25.6-46.4l59.1-158.6h-34.4z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" viewBox="0 0 500 500" focusable="false"><path d="M80 0h340a80 80 0 0 1 80 80v420H80a80 80 0 0 1-80-80V80A80 80 0 0 1 80 0z" fill="#7eadb9"/><path d="M406.1 242.34c-17.78 33-39 52.42-62.34 61.68-22.3 44.36-48.22 89-67.16 120.32-15.71 26-26.6 42.88-26.6 42.88s-10.89-16.87-26.6-42.88c-27.88-46.14-70.91-121-95.19-181.56-3.93-9.81-7.34-19.21-10.15-28.08C80.51 192.27 30.88 234.16 0 273.14V420a80 80 0 0 0 80 80h420V147.7c-49-5.97-75.75 62.88-93.9 94.64z" fill="#7e9358"/><path d="M343.76 304l1.12-2.24c18.66-37.31 34.61-74.28 41.53-102.85 2.37-9.78 3.69-18.57 3.69-26.05a140.1 140.1 0 0 0-280.2 0c0 2.17.12 4.46.33 6.84.91 10 3.69 21.92 7.83 35a49.64 49.64 0 0 1 5 3.35c71.7 57.39 154.76 112.11 220.7 85.95z" fill="#f6a446"/><path d="M223.4 424.34c15.71 26 26.6 42.88 26.6 42.88s10.89-16.87 26.6-42.88c18.94-31.34 44.86-76 67.16-120.32-65.94 26.14-149-28.58-220.74-86a49.64 49.64 0 0 0-5-3.35c2.81 8.87 6.22 18.27 10.15 28.08 24.32 60.54 67.35 135.45 95.23 181.59z" fill="#eb7d29"/><path d="M285.39 86.18l-41.65 115.7-19.87-62.21h-30.42L227 225.79a30.9 30.9 0 0 1 0 22.51c-3.14 8.05-8.29 16.63-22.73 19.28l-2.37.44V294l3-.11c13.51-.53 24-5 33-14s16.66-23 24.14-43.87l55.84-149.84z" fill="#fff"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500" role="img" aria-hidden="true" focusable="false"><path fill="#835069" d="M500 450H60c-33.1 0-60-26.9-60-60V60C0 26.9 26.9 0 60 0h380c33.1 0 60 26.9 60 60v390z"/><path fill="#5B2942" d="M415.2 35l41.6 415H205.5z"/><path fill="#D1D0BD" d="M93.7 122.2L85 183.1l7.3 56.5-5.8 56.5 8.7 66.7-8.7 86.9 31.8 27.6 30.5-8.7 53.6 10.1 30.4 5.8 60.9-5.8 59.4 7.3 61.9-9.9V35H87.5l-1 40.8z"/><path fill="#7172A3" d="M122.7 262h96.7v17h-96.7z"/><path d="M309.1 292h78.2v17h-78.2zm-186.4 0h159.4v17H122.7zm0 28h56.1v17h-56.1zm83.1 0h181.5v17H205.8zm-83.1 28h127.7v17H122.7zm154.7 0h110v17h-110zm-70.9 28h104.3v17H206.5zm-83.8 0h56.8v17h-56.8zm215.1 0h49.6v17h-49.6zm-86.6 28h136.1v17H251.2zm-128.5 0h101.5v17H122.7zm0 28h239.6v17H122.7zm0-363h264.7v162.6H122.7z" fill="#9595BA"/><path fill="#7172A3" d="M387.4 231.6h-87.9l-13.6 9.6-62.7 1.1-10.7-10.7h-89.7C287.4 190 239.7 100.9 387.4 69v162.6z"/><g fill="#FFF"><path d="M278.8 82h-47.5c-15.1 0-27.3 12.3-27.3 27.4v107.2c0 15.1 12.2 27.4 27.3 27.4h47.5c15.1 0 27.3-12.3 27.3-27.4V109.4c0-15.1-12.2-27.4-27.3-27.4zm19.8 134.9c0 11-9.1 20-20.2 20h-46.8c-11.1 0-20.2-9-20.2-20V109.3c0-5.4 2.1-10.4 5.9-14.1 3.8-3.7 8.8-5.7 14.2-5.7h46.8c5.4 0 10.4 2 14.2 5.7 3.8 3.7 6 8.7 6 14.1v107.6z"/><circle cx="255" cy="163" r="19.4"/><circle cx="255" cy="119.6" r="19.4"/><circle cx="255" cy="206.4" r="19.4"/></g><circle fill="#494A7B" cx="255" cy="163" r="19.4"/><path fill="#7172A3" d="M262.7 145.2c-2.3-1-4.9-1.6-7.7-1.6-10.7 0-19.4 8.7-19.4 19.4 0 3.3.8 6.4 2.3 9.2 9.2-8.9 17.1-18 24.8-27z"/><circle fill="#7172A3" cx="255" cy="119.6" r="19.4"/><circle fill="#494A7B" cx="255" cy="206.4" r="19.4"/><path fill="none" d="M231.6 235.4h46.8c4.2 0 8.1-1.4 11.3-3.8h-69.4c3.2 2.4 7.1 3.8 11.3 3.8zm60-139.1c-3.5-3.4-8.2-5.3-13.2-5.3h-46.8c-5 0-9.7 1.9-13.2 5.3s-5.5 8.1-5.5 13V193c38.1-26.7 53.4-57.8 84.2-83.5v-.2c0-4.9-1.9-9.6-5.5-13z"/><path fill="#7172A3" d="M212.9 109.3c0-5 1.9-9.6 5.5-13 3.5-3.4 8.2-5.3 13.2-5.3h46.8c5 0 9.7 1.9 13.2 5.3s5.5 8.1 5.5 13v.2c3-2.5 6.2-5 9.6-7.4-3.2-12.4-14.5-21.7-27.9-21.7h-47.5c-15.9 0-28.8 13-28.8 28.9v90.5c3.7-2.3 7.2-4.5 10.5-6.9v-83.6z"/><path fill="#494A7B" d="M306.7 102.2c-3.4 2.4-6.5 4.9-9.6 7.4V217c0 6-2.9 11.3-7.4 14.7-3.1 2.4-7 3.8-11.3 3.8h-46.8c-4.2 0-8.1-1.4-11.3-3.8-4.5-3.4-7.4-8.7-7.4-14.7v-24c-3.3 2.3-6.8 4.6-10.5 6.9v16.7c0 5.5 1.5 10.6 4.2 15 5.1 8.3 14.2 13.9 24.6 13.9h47.5c10.4 0 19.5-5.6 24.6-13.9 2.7-4.4 4.2-9.5 4.2-15V109.4c.1-2.5-.2-4.9-.8-7.2z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" viewBox="0 0 500 500" focusable="false"><path d="M80 0h340a80 80 0 0 1 80 80v420H80a80 80 0 0 1-80-80V80A80 80 0 0 1 80 0z" fill="#835069"/><path fill="#5b2942" d="M415.18 27.51l41.64 415H205.48l209.7-415z"/><path fill="#d1d0bd" d="M93.7 114.72l-8.69 60.87 7.24 56.52-5.8 56.52 8.7 66.67-8.7 86.95 31.89 27.54 30.43-8.7 53.63 10.15 30.43 5.8 60.87-5.8 59.42 7.25 61.87-9.9V27.51H87.54l-1.09 40.83 7.25 46.38z"/><path fill="#7172a3" d="M122.7 254.51h96.7v17.03h-96.7z"/><path fill="#9595ba" d="M309.13 284.51h78.23v17.03h-78.23zm-186.43 0h159.42v17.03H122.7zm0 28h56.13v17.03H122.7zm83.15 0h181.52v17.03H205.85zm-83.15 28h127.65v17.03H122.7zm154.67 0h110v17.03h-110zm-70.84 28h104.25v17.03H206.53zm-83.83 0h56.82v17.03H122.7zm215.1 0h49.56v17.03H337.8zm-86.58 28h136.15v17.03H251.22zm-128.52 0h101.5v17.03H122.7zm0 28h239.59v17.03H122.7zm-.01-363v162.63h99.55l92.24-162.63H122.69z"/><path fill="#7172a3" d="M387.36 61.51h-72.88l-92.24 162.63h165.12V61.51zM184.43 187v11.91c7.37-.31 13.14-2.73 18-7.68s9.35-13 13.62-24.88l31.6-84.64h-15.27l-25.46 70.71-12.63-39.65h-14l18.57 47.71a19.63 19.63 0 0 1 0 14.27c-1.86 4.86-5.25 10.56-14.43 12.25z"/><path d="M301.09 84.87l-32.7 57.85a33.23 33.23 0 0 0 32.7-57.85z" fill="#494a7b"/><path d="M255.8 97.46a33.2 33.2 0 0 0 12.58 45.25l32.7-57.85a33.21 33.21 0 0 0-45.26 12.54z" fill="#7172a3"/><path d="M259.55 158.11l-21.37 37.82a21.72 21.72 0 1 0 21.37-37.82z" fill="#494a7b"/><path d="M259.62 158.18a21.71 21.71 0 0 0-21.4 37.82z" fill="#7172a3"/><path d="M228.29 213.47l-12.84 22.7a13 13 0 0 0 12.8-22.7z" fill="#494a7b"/><path d="M228.29 213.5a13 13 0 0 0-14 22c.37.23.74.44 1.12.64z" fill="#7172a3"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 450" role="img" aria-hidden="true" focusable="false"><path fill="#5B2942" d="M382 0H60C26.9 0 0 26.9 0 60v128.9L382 9.1V0z"/><path fill="#C88A57" d="M452 1.2V29c0 3.3-2.7 6-6 6h-58c-3.3 0-6-2.7-6-6V9.1L0 188.9V390c0 33.1 26.9 60 60 60h1.1L500 243.4V60c0-29-20.6-53.2-48-58.8zm0 248.8c0 3.3-2.7 6-6 6h-58c-3.3 0-6-2.7-6-6v-50c0-3.3 2.7-6 6-6h58c3.3 0 6 2.7 6 6v50zm0-110.5c0 3.3-2.7 6-6 6h-58c-3.3 0-6-2.7-6-6v-50c0-3.3 2.7-6 6-6h58c3.3 0 6 2.7 6 6v50z"/><path fill="#5B2942" d="M445.6 35h.4c3.3 0 6-2.7 6-6V1.2c-2.1-.4-4.2-.7-6.4-.9V35zm.4 48.5h-58c-3.3 0-6 2.7-6 6v.3h57.6c3.3 0 6 2.7 6 6v49.7h.4c3.3 0 6-2.7 6-6v-50c0-3.3-2.7-6-6-6zm0 110.5h-58c-3.3 0-6 2.7-6 6v.3h57.6c3.3 0 6 2.7 6 6V256h.4c3.3 0 6-2.7 6-6v-50c0-3.3-2.7-6-6-6zM61.1 450H382v-28.7h57.6c3.3 0 6 2.7 6 6V450H500V243.4L61.1 450zM382 310.8h57.6c3.3 0 6 2.7 6 6v49.7H388c-3.3 0-6-2.7-6-6v-49.7z"/><path d="M15 247.5V375c0 33.1 26.9 60 60 60h255V247.5H15zM75 15c-33.1 0-60 26.9-60 60v127.5h315V15H75z" fill="#F7E2CA"/><path fill="#77B227" d="M218.2 257.5l-53.5 148.8-25.6-80H100L142.3 435h51.5L260 257.5zm-45.1-133.7c-4 10.3-10.7 21.4-29.2 24.8l-3 .6v33.4l3.9-.2c17.4-.7 30.9-6.4 42.4-18.1 11.6-11.6 21.4-29.6 31-56.4L252.8 15h-40.5l-17.7 49.1L179 15h-37l31.1 79.9c3.7 9.3 3.6 19.6 0 28.9z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" viewBox="0 0 500 500" focusable="false"><path d="M369 0H80A80 80 0 0 0 0 80v129.72L369 10.19zm-.48 468.06h63.89a6.33 6.33 0 0 1 6.48 6.48V500H500V270.37L69.49 499.29A80.89 80.89 0 0 0 80 500h288.52v-31.94zm.48-122.19h63.89a6.33 6.33 0 0 1 6.48 6.48v55.1h-63.93A6.48 6.48 0 0 1 369 401z" fill="#5b2942"/><path d="M2.78 440.92zm1.08 3.66zm29.08 40.1zm-17.86-17.96a78.81 78.81 0 0 1-4.67-7.27 81 81 0 0 0 4.67 7.27zM1.13 433.35c-.09-.55-.19-1.09-.27-1.64.08.55.14 1.09.27 1.64zm.74 3.83c-.12-.56-.25-1.12-.36-1.68.11.56.24 1.12.36 1.68zM30 482.44c-.75-.6-1.48-1.21-2.21-1.84.75.63 1.48 1.24 2.21 1.84zm-2.79-2.36zM6.52 451.65c-.24-.56-.47-1.13-.7-1.7.23.57.46 1.14.7 1.7zm1.56 3.41c-.28-.57-.54-1.15-.8-1.73.26.58.52 1.16.8 1.73zm-2.97-6.91c-.21-.56-.41-1.12-.61-1.69.2.54.4 1.13.61 1.69zm19.4 29.45c-.63-.61-1.26-1.23-1.87-1.86.61.63 1.24 1.26 1.87 1.86zM.57 429.41c-.06-.52-.13-1-.18-1.55.05.52.12 1.03.18 1.55zm498.95-358.1c0 .37.08.74.11 1.11-.03-.37-.07-.74-.11-1.11zm.32 3.81c0 .37.05.75.07 1.12-.02-.37-.05-.75-.07-1.12zM69.28 499.26zM19.49 472.3q-.84-1-1.65-1.95.81.99 1.65 1.95zM62 497.94a79.75 79.75 0 0 1-28.9-13.14A79.59 79.59 0 0 0 62 497.94zm-44.81-28.43c-.54-.67-1.07-1.35-1.58-2 .51.65 1.04 1.33 1.58 2zM499.06 67.7c0 .16 0 .33.07.49-.03-.19-.05-.33-.07-.49zM21.94 475zM.19 425.27c0-.44-.07-.87-.09-1.32.02.45.06.88.09 1.32zm65.41 73.41zm-55.8-40.3c-.33-.59-.63-1.2-.94-1.8.31.6.61 1.21.94 1.8z" fill="#835069"/><path d="M22.64 475.74l-.7-.74zm10.46 9.06l-.16-.12zm-7.92-6.56l-.67-.64zM65.7 498.7h-.1zm3.58.56zM62.1 498h-.09zm-34.29-17.4l-.6-.52zm2.66 2.2l-.45-.36zm-10.28-9.7c-.24-.26-.47-.53-.7-.8.23.27.51.54.7.8zM1.51 435.5c-.14-.71-.26-1.43-.38-2.15.12.72.24 1.44.38 2.15zM499.13 68.19q.22 1.55.39 3.12-.16-1.57-.39-3.12zM.39 427.86c-.09-.86-.14-1.72-.2-2.59.06.87.11 1.73.2 2.59zM.1 424c-.1-1.36-.1-2.67-.1-4 0 1.33 0 2.64.1 4zm.76 7.71c-.11-.76-.2-1.53-.29-2.3.09.77.18 1.59.29 2.3zM499.91 76.24c0 1.25.09 2.5.09 3.76 0-1.26 0-2.51-.09-3.76zM17.84 470.35l-.65-.84zM499.63 72.42c.09.9.15 1.8.21 2.7-.06-.9-.12-1.8-.21-2.7zM2.34 439.23c-.17-.68-.32-1.37-.47-2.05.13.68.3 1.37.47 2.05zm6.52 17.35c-.26-.5-.53-1-.78-1.52.25.51.52 1.02.78 1.52zm1.55 2.87c-.2-.36-.42-.71-.61-1.07.2.36.41.71.61 1.07zm5.2 8.02l-.53-.75zM5.82 450c-.24-.6-.48-1.19-.71-1.8.23.56.47 1.15.71 1.8zm-1.32-3.54zm-1.16-3.58c-.2-.65-.38-1.31-.56-2 .22.69.36 1.35.56 2zm3.94 10.45c-.26-.56-.52-1.11-.76-1.68.24.57.48 1.12.76 1.68z" fill="#c88a57"/><path d="M499.91 76.24c0-.37-.05-.75-.07-1.12-.06-.9-.12-1.8-.21-2.7 0-.37-.07-.74-.11-1.11q-.16-1.57-.39-3.12c0-.16-.05-.33-.07-.49A80.11 80.11 0 0 0 446.3 4.44v28a6.33 6.33 0 0 1-6.48 6.48h-64.38a6.48 6.48 0 0 1-6.44-6.49V10.19L0 209.72V420c0 1.33 0 2.64.1 3.95 0 .45.06.88.09 1.32.06.87.11 1.73.2 2.59 0 .52.12 1 .18 1.55.09.77.18 1.54.29 2.3.08.55.18 1.09.27 1.64.12.72.24 1.44.38 2.15s.24 1.12.36 1.68.3 1.37.47 2.05.29 1.13.44 1.69.36 1.31.56 2 .34 1.13.52 1.7.42 1.25.64 1.88.4 1.13.61 1.69.47 1.2.71 1.8.46 1.14.7 1.7.5 1.12.76 1.68.52 1.16.8 1.73.52 1 .78 1.52.61 1.21.94 1.8c.19.36.41.71.61 1.07a78.81 78.81 0 0 0 4.67 7.27l.53.75c.51.69 1 1.37 1.58 2l.65.84q.81 1 1.65 1.95c.23.27.46.54.7.8.57.65 1.16 1.28 1.75 1.9l.7.74c.61.63 1.24 1.25 1.87 1.86l.67.64c.67.63 1.34 1.24 2 1.84l.6.52c.73.63 1.46 1.24 2.21 1.84l.45.36c.81.64 1.63 1.27 2.47 1.88l.16.12A79.75 79.75 0 0 0 62 497.94h.09c1.16.26 2.32.5 3.5.71h.1c1.19.21 2.38.4 3.58.56L500 270.37V80c0-1.26 0-2.51-.09-3.76zM369 99.07a6.33 6.33 0 0 1 6.48-6.48h64.35c3.71 0 6.95 3.24 6.49 6.48v55.56a6.33 6.33 0 0 1-6.49 6.48h-64.39a6.48 6.48 0 0 1-6.46-6.46V99.54zm77.3 123.15v55.56a6.33 6.33 0 0 1-6.48 6.48h-64.38a6.48 6.48 0 0 1-6.44-6.46v-55.58a6.33 6.33 0 0 1 6.48-6.48h64.36c3.68 0 6.92 3.26 6.46 6.48z" fill="#c88a57"/><path d="M439.81 92.59h-64.35a6.33 6.33 0 0 0-6.46 6.48v.47h63.89a6.33 6.33 0 0 1 6.48 6.48v55.09h.46a6.33 6.33 0 0 0 6.49-6.48V99.07c.44-3.24-2.8-6.48-6.51-6.48zm.01 123.15h-64.36a6.33 6.33 0 0 0-6.48 6.48v.47h63.89a6.33 6.33 0 0 1 6.48 6.48v55.09h.47a6.33 6.33 0 0 0 6.48-6.48v-55.56c.46-3.22-2.78-6.48-6.48-6.48zm-.47-213.37c1.95.48 3.87 1 5.76 1.67" fill="#5b2942"/><path d="M439.54 38.89h.28a6.33 6.33 0 0 0 6.48-6.48v-28q-3.41-1.19-6.95-2.07v36.55z" fill="#5b2942"/><path d="M325 272H17v131a80 80 0 0 0 80 80h228z" fill="#f7e2ca"/><path fill="#77b227" d="M214.81 285.78l-59.72 165.28-28.24-88.89H83.33L130.56 483h56.94l73.61-197.22h-46.3z"/><path d="M325 227l-308 1V97a80 80 0 0 1 80-80h228z" fill="#f7e2ca"/><path d="M164.35 137.83c-4.63 11.58-12 23.61-32.41 27.78l-3.24.46v37h4.17c19.45-.92 34.26-6.94 47.22-19.91s23.61-32.87 34.26-62.5l38.43-103.2h-44.45l-19.44 54.63L171.3 17h-41.21l34.73 88.89a44.7 44.7 0 0 1-.47 31.94z" fill="#77b227"/><path d="M439.81 338.89h-64.35a6.33 6.33 0 0 0-6.48 6.48v.46a6.48 6.48 0 0 1 6.46-6.42h64.08a6.48 6.48 0 0 1 6.46 6.46V401a6.49 6.49 0 0 1-6.44 6.46h.27a6.34 6.34 0 0 0 6.49-6.49v-55.6c.46-3.24-2.78-6.48-6.49-6.48z" fill="#5b2942"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500" role="img" aria-hidden="true" focusable="false"><path fill="#B5DCF3" d="M500 450H60c-33.1 0-60-26.9-60-60V60C0 26.9 26.9 0 60 0h380c33.1 0 60 26.9 60 60v390z"/><path fill="#97BED1" d="M500 60c0-33.1-26.9-60-60-60H246.8v450H500V60z"/><circle fill="#F49A00" cx="346.9" cy="227.8" r="73.7"/><circle fill="#ED261F" cx="204.3" cy="225.1" r="73.7"/><path fill="#FEC228" d="M310 291.7c-35.3-20.4-47.4-65.5-27-100.7s65.5-47.4 100.7-27"/><path fill="#FF4E47" d="M167.4 288.9c-35.3-20.4-47.4-65.5-27-100.7s65.5-47.4 100.7-27l-73.7 127.7z"/><circle fill="#77B227" cx="278.8" cy="123.3" r="85.3"/><path fill="#9FDA4F" d="M236.1 197.1c-40.8-23.5-54.7-75.7-31.2-116.5s75.7-54.7 116.5-31.2"/><path d="M346.8 419.8c-16.7 0-30.2 13.6-30.2 30.2s13.6 30.2 30.2 30.2S377 466.7 377 450s-13.6-30.2-30.2-30.2zm-154 0c-16.7 0-30.2 13.6-30.2 30.2s13.6 30.2 30.2 30.2S223 466.7 223 450s-13.5-30.2-30.2-30.2zm289.6-260.1h-47.1l-46.1 125.6H164.6l-62.5-185H19v38h48.6l90.5 264H373v-35H192.6l-12.3-36h240.3z" fill="#5B2942"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" viewBox="0 0 500 500" focusable="false"><path d="M80 0h340a80 80 0 0 1 80 80v420H80a80 80 0 0 1-80-80V80A80 80 0 0 1 80 0z" fill="#b5dcf3"/><path d="M420 0H246.44v500H500V80a80 80 0 0 0-80-80z" fill="#97bed1"/><circle cx="344.23" cy="226.47" r="72.21" fill="#f49a00"/><circle cx="204.56" cy="223.81" r="72.21" fill="#ed261f"/><path d="M308.12 289a72.21 72.21 0 0 1 72.21-125.07" fill="#fec228"/><path d="M168.46 286.35a72.21 72.21 0 1 1 72.21-125.08z" fill="#ff4e47"/><circle cx="277.5" cy="124.13" r="83.48" fill="#77b227"/><path d="M235.76 196.42a83.47 83.47 0 1 1 83.48-144.58" fill="#9fda4f"/><circle cx="344.1" cy="438.01" r="29.58" fill="#5b2942"/><circle cx="193.34" cy="438.01" r="29.58" fill="#5b2942"/><path fill="#5b2942" d="M476.85 155.8h-46.11l-45.15 122.96H165.72L104.51 97.61H23.15v37.2h47.54l88.68 258.5h210.39v-34.27H193.15l-12.11-35.25h235.32l60.49-167.99z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 488.22" role="img" aria-hidden="true" focusable="false"><path d="M436.82 4.06A90 90 0 0 0 410 0H90A90 90 0 0 0 0 90v270a90 90 0 0 0 90 90h410V90a90 90 0 0 0-63.18-85.94z" fill="#a4286a"/><path d="M436.82 4.06L184.15 450H500V90a90 90 0 0 0-63.18-85.94z" fill="#6c2548"/><path d="M74.4 339.22v34.93c21.63-.85 38.51-8 52.84-22.46 14.76-14.83 27.45-38 39.93-72.85l92.53-248H215l-74.6 207.07-37.09-116.15h-41l54.42 139.79a57.49 57.49 0 0 1 0 41.84c-5.52 14.2-15.35 30.88-42.33 35.83z" fill="#fff"/><circle cx="368.33" cy="124.68" r="97.34" transform="rotate(-45 368.335 124.68)" fill="#9fda4f"/><path d="M416.2 39.93l-95.74 169.51A97.34 97.34 0 1 0 416.2 39.93z" fill="#77b227"/><path d="M294.78 254.75l-.15-.08-.13-.07a63.6 63.6 0 0 0-62.56 110.76h.13a63.6 63.6 0 0 0 62.71-110.67z" fill="#fec228"/><path d="M294.5 254.59l-62.56 110.76a63.6 63.6 0 1 0 62.56-110.76z" fill="#f49a00"/><path d="M222.31 450.07A38.16 38.16 0 0 0 203 416.83a38.18 38.18 0 1 0 19.41 33.27z" fill="#ff4e47"/><path d="M202.9 416.8l-37.54 66.48a38.17 38.17 0 0 0 37.54-66.48z" fill="#ed261f"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" viewBox="0 0 500 500" focusable="false"><path d="M80 0h340a80 80 0 0 1 80 80v420H80a80 80 0 0 1-80-80V80A80 80 0 0 1 80 0z" fill="#a4286a"/><path d="M437.61 2L155.89 500H500V80a80 80 0 0 0-62.39-78z" fill="#6c2548"/><path d="M74.4 337.3v34.9c21.6-.9 38.5-8 52.8-22.5s27.4-38 39.9-72.9l92.6-248h-44.8L140.3 236l-37-116.2h-41l54.4 139.8a57.54 57.54 0 0 1 0 41.8c-5.5 14.2-15.4 30.9-42.3 35.9z" fill="#fff"/><circle cx="368.33" cy="124.68" r="97.34" transform="rotate(-45 368.335 124.68)" fill="#9fda4f"/><path d="M416.2 39.93l-95.74 169.51A97.34 97.34 0 1 0 416.2 39.93z" fill="#77b227"/><path d="M294.78 254.75l-.15-.08-.13-.07a63.6 63.6 0 0 0-62.56 110.76h.13a63.6 63.6 0 0 0 62.71-110.67z" fill="#fec228"/><path d="M294.5 254.59l-62.56 110.76a63.6 63.6 0 1 0 62.56-110.76z" fill="#f49a00"/><path d="M222.31 450.07A38.16 38.16 0 0 0 203 416.83a38.18 38.18 0 1 0 19.41 33.27z" fill="#ff4e47"/><path d="M202.9 416.8l-37.54 66.48a38.17 38.17 0 0 0 37.54-66.48z" fill="#ed261f"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512" role="img" aria-hidden="true" focusable="false"><path fill="#dc3232" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"/></svg>
\ No newline at end of file
<svg width="16" height="16" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" focusable="false"><path d="M1024 1375v-190q0-14-9.5-23.5T992 1152H800q-13 0-22.5 9.5T768 1185v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11H786q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17H128q-34 0-63.5-17T18 1601q-37-63-2-126L784 67q17-31 47-49t65-18 65 18 47 49z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 522" role="img" aria-hidden="true" focusable="false"><defs><clipPath id="a" transform="translate(0 15.84)"><path d="M214.89 403.32l-7.17-4.05L196 411.76l-6.81-.73-8.19-14.71-8 2.35.3 17.05-5.45 4.33-16.33-4.47-4.1 7.28 12.25 11.59-.86 6.87-14.81 8.56 2.15 8 16.92-.61 4.2 5.38-4.73 16.35 7.17 4.05 11.73-12.49 6.81.73 8.24 14.71 8-2.35-.3-17 5.46-4.33 16.28 4.32 4.1-7.28-12.24-11.59.85-6.87 14.79-8.55-2.16-8-16.92.62-4.2-5.39zM203 449.12a16.59 16.59 0 0 1-22.46 6.52 16.35 16.35 0 0 1-6.06-22.44 16.65 16.65 0 0 1 22.45-6.52 16.35 16.35 0 0 1 6.07 22.44z" fill="none"/></clipPath><clipPath id="b" transform="translate(0 15.84)"><path d="M338.15 291.36l-3.69-12.66-27.46 1.08-6.86-8.44 7.23-26.12-11.71-6.35-18.82 19.89-11-1.19-13.68-23.29-12.91 3.79.9 27-8.68 6.83-26.53-6.79-6.58 11.55 20 18.23-1.36 10.82-23.88 13.6 3.72 12.69 27.47-1.08 6.86 8.44-7.23 26.12 11.71 6.35 18.82-19.89 11 1.19 13.68 23.28 12.91-3.78-.9-27 8.68-6.83 26.53 6.79 6.58-11.55-20-18.23 1.3-10.86zM273 330.53c-14.16 4.11-28.94-3.82-33-17.73s4.23-28.41 18.4-32.52 28.94 3.81 33 17.72-4.25 28.41-18.4 32.53z" fill="none"/></clipPath><clipPath id="c" transform="translate(0 15.84)"><path d="M450.3 180.81l8.7-15.31-26.85-25.08 1.59-14.56 31.71-17.65-4.93-17.15-36.59.66-9.28-11.66 9.47-34.81-15.66-8.78-25 26-14.8-1.85-18.31-31.7-17.23 4.62 1.39 36.23L323 78.68l-35.45-10L278.8 84l26.85 25.08-1.59 14.57-31.71 17.65 4.93 17.14 36.59-.65 9.28 11.65-9.32 34.77L329.5 213l25-26 14.81 1.86 18.3 31.69 17.2-4.55-1.38-36.23L415 170.8zm-98.51-25.51c-17.23-9.69-23.52-31.3-13.86-48 9.46-16.85 31.19-22.67 48.27-12.94 17.24 9.69 23.53 31.3 13.87 48-9.46 16.85-31.07 22.64-48.28 12.94z" fill="none"/></clipPath></defs><path d="M436.82 19.9A90 90 0 0 0 410 15.84H90a90 90 0 0 0-90 90v270a90 90 0 0 0 90 90h410v-360a90 90 0 0 0-63.18-85.94z" fill="#008578"/><path d="M436.8 19.94l-252.7 445.9H500v-360a90 90 0 0 0-63.2-85.9z" fill="#005d50"/><path d="M74.4 355.14v34.9c21.6-.9 38.5-8 52.8-22.5s27.4-38 39.9-72.9l92.6-248h-44.8l-74.6 207.2-37-116.2h-41l54.4 139.8a57.54 57.54 0 0 1 0 41.8c-5.5 14.2-15.4 30.9-42.3 35.9z" fill="#fff"/><g fill="#008578"><circle cx="367.46" cy="144.56" r="47.35"/><circle cx="267.18" cy="319.33" r="31.23"/><ellipse cx="192.45" cy="458.04" rx="20.2" ry="20.84"/></g><path d="M214.89 419.16l-7.17-4.05L196 427.6l-6.81-.73-8.19-14.71-8 2.35.3 17.05-5.45 4.33-16.33-4.47-4.1 7.28 12.25 11.59-.86 6.87-14.81 8.56 2.15 8 16.92-.61 4.2 5.38-4.73 16.35 7.17 4.05 11.73-12.49 6.81.73 8.24 14.71 8-2.35-.3-17 5.46-4.33 16.28 4.32 4.1-7.28-12.24-11.59.85-6.87 14.79-8.55-2.16-8-16.92.62-4.2-5.39zM203 464.96a16.59 16.59 0 0 1-22.46 6.52 16.35 16.35 0 0 1-6.06-22.44 16.65 16.65 0 0 1 22.45-6.52 16.35 16.35 0 0 1 6.07 22.44z" fill="#ed261f"/><g clip-path="url(#a)"><path fill="#ff4e47" d="M227.89 389.09L150.95 522l-27.92-106.44 105.18-25.4-.32-1.07z"/></g><path d="M338.15 307.2l-3.69-12.66-27.46 1.08-6.86-8.44 7.23-26.12-11.71-6.35-18.82 19.89-11-1.19-13.68-23.29-12.91 3.79.9 27-8.68 6.83-26.53-6.79-6.58 11.55 20 18.23-1.36 10.82-23.88 13.6 3.72 12.69 27.47-1.08 6.86 8.44-7.23 26.12 11.71 6.35 18.82-19.89 11 1.19 13.68 23.28 12.91-3.78-.9-27 8.68-6.83 26.53 6.79 6.58-11.55-20-18.23 1.3-10.86zM273 346.37c-14.16 4.11-28.94-3.82-33-17.73s4.23-28.41 18.4-32.52 28.94 3.81 33 17.72-4.25 28.41-18.4 32.53z" fill="#f49a00"/><g clip-path="url(#b)"><path fill="#fec228" d="M320.6 224.05L209.78 419.88l-56.16-171.22 166.98-24.61z"/></g><path d="M450.3 196.65l8.7-15.31-26.85-25.08 1.59-14.56 31.71-17.65-4.93-17.15-36.59.66-9.28-11.66 9.47-34.81-15.66-8.78-25 26-14.8-1.85-18.31-31.7-17.23 4.62 1.39 36.23L323 94.52l-35.45-10-8.75 15.32 26.85 25.08-1.59 14.57-31.71 17.65 4.93 17.14 36.59-.65 9.28 11.65-9.32 34.77 15.67 8.79 25-26 14.81 1.86 18.3 31.69 17.2-4.55-1.38-36.23 11.57-8.97zm-98.51-25.51c-17.23-9.69-23.52-31.3-13.86-48 9.46-16.85 31.19-22.67 48.27-12.94 17.24 9.69 23.53 31.3 13.87 48-9.46 16.85-31.07 22.64-48.28 12.94z" fill="#77b227"/><g clip-path="url(#c)"><path fill="#9fda4f" d="M447.85 0L280.9 294.61l-51.19-251.3L447.85 0z"/></g></svg>
\ No newline at end of file
......@@ -25,7 +25,6 @@ class WPSEO_MyYoast_Api_Request {
protected $args = array(
'method' => 'GET',
'timeout' => 5,
'sslverify' => false,
'headers' => array(
'Accept-Encoding' => '*',
),
......
......@@ -9,7 +9,6 @@
* Class to load assets required for structured data blocks.
*/
class WPSEO_Structured_Data_Blocks implements WPSEO_WordPress_Integration {
/**
* An instance of the WPSEO_Admin_Asset_Manager class.
*
......@@ -17,13 +16,6 @@ class WPSEO_Structured_Data_Blocks implements WPSEO_WordPress_Integration {
*/
protected $asset_manager;
/**
* WPSEO_Structured_Data_Blocks constructor.
*/
public function __construct() {
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
}
/**
* Registers hooks for Structured Data Blocks with WordPress.
*/
......@@ -32,10 +24,34 @@ class WPSEO_Structured_Data_Blocks implements WPSEO_WordPress_Integration {
add_filter( 'block_categories', array( $this, 'add_block_category' ) );
}
/**
* Checks whether the Structured Data Blocks are disabled.
*
* @return boolean
*/
private function check_enabled() {
/**
* Filter: 'wpseo_enable_structured_data_blocks' - Allows disabling Yoast's schema blocks entirely.
*
* @api bool If false, our structured data blocks won't show.
*/
$enabled = apply_filters( 'wpseo_enable_structured_data_blocks', true );
return $enabled;
}
/**
* Enqueue Gutenberg block assets for backend editor.
*/
public function enqueue_block_editor_assets() {
if ( ! $this->check_enabled() ) {
return;
}
if ( ! $this->asset_manager ) {
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
}
$this->asset_manager->enqueue_script( 'structured-data-blocks' );
$this->asset_manager->enqueue_style( 'structured-data-blocks' );
}
......@@ -48,14 +64,16 @@ class WPSEO_Structured_Data_Blocks implements WPSEO_WordPress_Integration {
* @return array The updated categories.
*/
public function add_block_category( $categories ) {
$categories[] = array(
'slug' => 'yoast-structured-data-blocks',
'title' => sprintf(
if ( $this->check_enabled() ) {
$categories[] = array(
'slug' => 'yoast-structured-data-blocks',
'title' => sprintf(
/* translators: %1$s expands to Yoast. */
__( '%1$s Structured Data Blocks', 'wordpress-seo' ),
'Yoast'
),
);
__( '%1$s Structured Data Blocks', 'wordpress-seo' ),
'Yoast'
),
);
}
return $categories;
}
......
......@@ -132,6 +132,11 @@ class WPSEO_Upgrade {
$this->upgrade_111();
}
if ( version_compare( $version, '12.1-RC0', '<' ) ) {
/** Reset notifications because we removed the AMP Glue plugin notification */
$this->clean_all_notifications();
}
// Since 3.7.
$upsell_notice = new WPSEO_Product_Upsell_Notice();
$upsell_notice->set_upgrade_notice();
......
......@@ -135,7 +135,7 @@ class WPSEO_Rank {
*/
public function get_label() {
$labels = array(
self::NO_FOCUS => __( 'Not available', 'wordpress-seo' ),
self::NO_FOCUS => __( 'Focus Keyphrase not set', 'wordpress-seo' ),
self::NO_INDEX => __( 'No index', 'wordpress-seo' ),
self::BAD => __( 'Needs improvement', 'wordpress-seo' ),
self::OK => __( 'OK', 'wordpress-seo' ),
......
......@@ -1446,9 +1446,3 @@ class WPSEO_Replace_Vars {
return apply_filters( 'wpseo_terms', $output, $taxonomy );
}
} /* End of class WPSEO_Replace_Vars */
/**
* Setup the class statics when the file is first loaded.
*/
WPSEO_Replace_Vars::setup_statics_once();
......@@ -807,7 +807,6 @@ class WPSEO_Utils {
'wpseo_tools',
'wpseo_search_console',
'wpseo_licenses',
'wpseo_courses',
);
return in_array( $current_page, $yoast_seo_free_pages, true );
......
......@@ -168,7 +168,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
elseif ( function_exists( 'add_settings_error' ) ) {
add_settings_error(
$this->group_name, // Slug title of the setting.
'_' . $key, // Suffix-ID for the error message box.
$key, // Suffix-ID for the error message box.
/* translators: %1$s expands to the option name and %2$sexpands to Yoast SEO */
sprintf( __( '%1$s is not a valid choice for who should be allowed access to the %2$s settings. Value reset to the default.', 'wordpress-seo' ), esc_html( sanitize_text_field( $dirty[ $key ] ) ), 'Yoast SEO' ), // The error message.
'error' // Error type, either 'error' or 'updated'.
......@@ -189,7 +189,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
elseif ( function_exists( 'add_settings_error' ) ) {
add_settings_error(
$this->group_name, // Slug title of the setting.
'_' . $key, // Suffix-ID for the error message box.
$key, // Suffix-ID for the error message box.
esc_html__( 'The default blog setting must be the numeric blog id of the blog you want to use as default.', 'wordpress-seo' )
. '<br>'
. sprintf(
......@@ -205,7 +205,7 @@ class WPSEO_Option_MS extends WPSEO_Option {
elseif ( function_exists( 'add_settings_error' ) ) {
add_settings_error(
$this->group_name, // Slug title of the setting.
'_' . $key, // Suffix-ID for the error message box.
$key, // Suffix-ID for the error message box.
esc_html__( 'The default blog setting must be the numeric blog id of the blog you want to use as default.', 'wordpress-seo' ) . '<br>' . esc_html__( 'No numeric value was received.', 'wordpress-seo' ), // The error message.
'error' // Error type, either 'error' or 'updated'.
);
......
......@@ -192,10 +192,10 @@ class WPSEO_Option_Social extends WPSEO_Option {
if ( function_exists( 'add_settings_error' ) ) {
add_settings_error(
$this->group_name, // Slug title of the setting.
'_' . $key, // Suffix-ID for the error message box.
$key, // Suffix-ID for the error message box.
sprintf(
/* translators: %s expands to a twitter user name. */
__( '%s does not seem to be a valid Twitter user-id. Please correct.', 'wordpress-seo' ),
__( '%s does not seem to be a valid Twitter Username. Please correct.', 'wordpress-seo' ),
'<strong>' . esc_html( sanitize_text_field( $dirty[ $key ] ) ) . '</strong>'
), // The error message.
'error' // Error type, either 'error' or 'updated'.
......@@ -203,6 +203,8 @@ class WPSEO_Option_Social extends WPSEO_Option {
}
}
unset( $twitter_id );
Yoast_Input_Validation::add_dirty_value_to_settings_errors( $key, $dirty[ $key ] );
}
break;
......@@ -219,9 +221,7 @@ class WPSEO_Option_Social extends WPSEO_Option {
break;
case 'fbadminapp':
if ( isset( $dirty[ $key ] ) && ! empty( $dirty[ $key ] ) ) {
$clean[ $key ] = $dirty[ $key ];
}
$this->validate_facebook_app_id( $key, $dirty, $old, $clean );
break;
}
}
......
......@@ -435,7 +435,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
*/
add_settings_error(
$this->group_name, // Slug title of the setting.
'_' . $key, // Suffix-id for the error message box.
$key, // Suffix-id for the error message box.
/* translators: %s expands to a post type. */
sprintf( __( 'Please select a valid taxonomy for post type "%s"', 'wordpress-seo' ), $post_type ), // The error message.
'error' // Error type, either 'error' or 'updated'.
......
......@@ -252,9 +252,9 @@ abstract class WPSEO_Option {
* Validate webmaster tools & Pinterest verification strings.
*
* @param string $key Key to check, by type of service.
* @param array $dirty Dirty data.
* @param array $dirty Dirty data with the new values.
* @param array $old Old data.
* @param array $clean Clean data by reference.
* @param array $clean Clean data by reference, normally the default values.
*/
public function validate_verification_string( $key, $dirty, $old, &$clean ) {
if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) {
......@@ -301,18 +301,22 @@ abstract class WPSEO_Option {
$clean[ $key ] = $meta;
}
else {
// Restore the previous value, if any.
if ( isset( $old[ $key ] ) && preg_match( $regex, $old[ $key ] ) ) {
$clean[ $key ] = $old[ $key ];
}
if ( function_exists( 'add_settings_error' ) ) {
add_settings_error(
$this->group_name, // Slug title of the setting.
'_' . $key, // Suffix-ID for the error message box.
$key, // Suffix-ID for the error message box. WordPress prepends `setting-error-`.
/* translators: 1: Verification string from user input; 2: Service name. */
sprintf( __( '%1$s does not seem to be a valid %2$s verification string. Please correct.', 'wordpress-seo' ), '<strong>' . esc_html( $meta ) . '</strong>', $service ), // The error message.
'error' // Error type, either 'error' or 'updated'.
'notice-error' // CSS class for the WP notice, either the legacy 'error' / 'updated' or the new `notice-*` ones.
);
}
Yoast_Input_Validation::add_dirty_value_to_settings_errors( $key, $meta );
}
}
}
......@@ -322,7 +326,7 @@ abstract class WPSEO_Option {
* Validates an option as a valid URL. Prints out a WordPress settings error
* notice if the URL is invalid.
*
* @param string $key Key to check, by type of service.
* @param string $key Key to check, by type of URL setting.
* @param array $dirty Dirty data with the new values.
* @param array $old Old data.
* @param array $clean Clean data by reference, normally the default values.
......@@ -370,6 +374,65 @@ abstract class WPSEO_Option {
}
}
/**
* Validates a Facebook App ID.
*
* @param string $key Key to check, in this case: the Facebook App ID field name.
* @param array $dirty Dirty data with the new values.
* @param array $old Old data.
* @param array $clean Clean data by reference, normally the default values.
*/
public function validate_facebook_app_id( $key, $dirty, $old, &$clean ) {
if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) {
$url = 'https://graph.facebook.com/' . $dirty[ $key ];
$response = wp_remote_get( $url );
// These filters are used in the tests.
/**
* Filter: 'validate_facebook_app_id_api_response_code' - Allows to filter the Faceboook API response code.
*
* @api int $response_code The Facebook API response header code.
*/
$response_code = apply_filters( 'validate_facebook_app_id_api_response_code', wp_remote_retrieve_response_code( $response ) );
/**
* Filter: 'validate_facebook_app_id_api_response_body' - Allows to filter the Faceboook API response body.
*
* @api string $response_body The Facebook API JSON response body.
*/
$response_body = apply_filters( 'validate_facebook_app_id_api_response_body', wp_remote_retrieve_body( $response ) );
$response_object = json_decode( $response_body );
/*
* When the request is successful the response code will be 200 and
* the response object will contain an `id` property.
*/
if ( $response_code === 200 && isset( $response_object->id ) ) {
$clean[ $key ] = $dirty[ $key ];
return;
}
// Restore the previous value, if any.
if ( isset( $old[ $key ] ) && $old[ $key ] !== '' ) {
$clean[ $key ] = $old[ $key ];
}
if ( function_exists( 'add_settings_error' ) ) {
add_settings_error(
$this->group_name, // Slug title of the setting.
$key, // Suffix-ID for the error message box. WordPress prepends `setting-error-`.
sprintf(
/* translators: %s expands to an invalid Facebook App ID. */
__( '%s does not seem to be a valid Facebook App ID. Please correct.', 'wordpress-seo' ),
'<strong>' . esc_html( $dirty[ $key ] ) . '</strong>'
), // The error message.
'notice-error' // CSS class for the WP notice, either the legacy 'error' / 'updated' or the new `notice-*` ones.
);
}
Yoast_Input_Validation::add_dirty_value_to_settings_errors( $key, $dirty[ $key ] );
}
}
/**
* Remove the default filters.
* Called from the validate() method to prevent failure to add new options.
......
......@@ -9,7 +9,6 @@
* Sitemap provider for author archives.
*/
class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
/**
* Holds image parser instance.
*
......@@ -83,12 +82,19 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
$all_taxonomies = array();
$term_args = array(
'hide_empty' => $hide_empty,
'fields' => 'ids',
);
foreach ( $taxonomy_names as $taxonomy_name ) {
/**
* Filter the setting of excluding empty terms from the XML sitemap for a specific taxonomy.
*
* @param boolean $exclude Defaults to the sitewide setting.
* @param string $taxonomy_name The name of the taxonomy being processed.
*/
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy_name );
$term_args = array(
'hide_empty' => $hide_empty_tax,
'fields' => 'ids',
);
$taxonomy_terms = get_terms( $taxonomy_name, $term_args );
if ( count( $taxonomy_terms ) > 0 ) {
......@@ -184,7 +190,9 @@ class WPSEO_Taxonomy_Sitemap_Provider implements WPSEO_Sitemap_Provider {
/** This filter is documented in inc/sitemaps/class-taxonomy-sitemap-provider.php */
$hide_empty = apply_filters( 'wpseo_sitemap_exclude_empty_terms', true, array( $taxonomy->name ) );
$terms = get_terms( $taxonomy->name, array( 'hide_empty' => $hide_empty ) );
/** This filter is documented in inc/sitemaps/class-taxonomy-sitemap-provider.php */
$hide_empty_tax = apply_filters( 'wpseo_sitemap_exclude_empty_terms_taxonomy', $hide_empty, $taxonomy->name );
$terms = get_terms( $taxonomy->name, array( 'hide_empty' => $hide_empty_tax ) );
// If the total term count is lower than the offset, we are on an invalid page.
if ( count( $terms ) < $offset ) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment