Commit 6001d9b4 authored by Simon's avatar Simon

Youtube video support added

parent 47cd0ea4
...@@ -268,8 +268,6 @@ class WPSEO_Admin { ...@@ -268,8 +268,6 @@ class WPSEO_Admin {
* *
* These are used with the Facebook author, rel="author" and Twitter cards implementation. * These are used with the Facebook author, rel="author" and Twitter cards implementation.
* *
* @link https://developers.google.com/search/docs/data-types/social-profile
*
* @param array $contactmethods Currently set contactmethods. * @param array $contactmethods Currently set contactmethods.
* *
* @return array $contactmethods with added contactmethods. * @return array $contactmethods with added contactmethods.
......
...@@ -17,6 +17,7 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration { ...@@ -17,6 +17,7 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
*/ */
private $shortlinks = [ private $shortlinks = [
'shortlinks.focus_keyword_info' => 'https://yoa.st/focus-keyword', 'shortlinks.focus_keyword_info' => 'https://yoa.st/focus-keyword',
'shortlinks.nofollow_sponsored' => 'https://yoa.st/nofollow-sponsored',
'shortlinks.snippet_preview_info' => 'https://yoa.st/snippet-preview', 'shortlinks.snippet_preview_info' => 'https://yoa.st/snippet-preview',
'shortlinks.cornerstone_content_info' => 'https://yoa.st/1i9', 'shortlinks.cornerstone_content_info' => 'https://yoa.st/1i9',
'shortlinks.upsell.sidebar.focus_keyword_synonyms_link' => 'https://yoa.st/textlink-synonyms-popup-sidebar', 'shortlinks.upsell.sidebar.focus_keyword_synonyms_link' => 'https://yoa.st/textlink-synonyms-popup-sidebar',
......
...@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility { ...@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
* *
* @var string * @var string
*/ */
const CURRENT_RELEASE = '8.2.1'; const CURRENT_RELEASE = '8.3.0';
/** /**
* The minimally supported version of Gutenberg by the plugin. * The minimally supported version of Gutenberg by the plugin.
* *
* @var string * @var string
*/ */
const MINIMUM_SUPPORTED = '8.2.1'; const MINIMUM_SUPPORTED = '8.3.0';
/** /**
* Holds the current version. * Holds the current version.
......
...@@ -69,7 +69,7 @@ class WPSEO_Metabox_Formatter { ...@@ -69,7 +69,7 @@ class WPSEO_Metabox_Formatter {
'isRtl' => is_rtl(), 'isRtl' => is_rtl(),
'isPremium' => WPSEO_Utils::is_yoast_seo_premium(), 'isPremium' => WPSEO_Utils::is_yoast_seo_premium(),
'addKeywordUpsell' => $this->get_add_keyword_upsell_translations(), 'addKeywordUpsell' => $this->get_add_keyword_upsell_translations(),
'wordFormRecognitionActive' => ( WPSEO_Language_Utils::get_language( get_locale() ) === 'en' ), 'wordFormRecognitionActive' => YoastSEO()->helpers->language->is_word_form_recognition_active( WPSEO_Language_Utils::get_language( get_locale() ) ),
'siteIconUrl' => get_site_icon_url(), 'siteIconUrl' => get_site_icon_url(),
/** /**
......
...@@ -1032,10 +1032,16 @@ class WPSEO_Metabox extends WPSEO_Meta { ...@@ -1032,10 +1032,16 @@ class WPSEO_Metabox extends WPSEO_Meta {
$custom_fields = get_post_custom( $post->ID ); $custom_fields = get_post_custom( $post->ID );
foreach ( $custom_fields as $custom_field_name => $custom_field ) { foreach ( $custom_fields as $custom_field_name => $custom_field ) {
// Skip private custom fields.
if ( substr( $custom_field_name, 0, 1 ) === '_' ) { if ( substr( $custom_field_name, 0, 1 ) === '_' ) {
continue; continue;
} }
// Skip custom field values that are serialized.
if ( is_serialized( $custom_field[0] ) ) {
continue;
}
$custom_replace_vars[ $custom_field_name ] = $custom_field[0]; $custom_replace_vars[ $custom_field_name ] = $custom_field[0];
} }
......
...@@ -93,8 +93,7 @@ class Yoast_View_Utils { ...@@ -93,8 +93,7 @@ class Yoast_View_Utils {
$this->form->show_hide_switch( $this->form->show_hide_switch(
'display-metabox-pt-' . $post_type->name, 'display-metabox-pt-' . $post_type->name,
/* translators: %1$s expands to Yoast SEO */ __( 'Show SEO settings for content type', 'wordpress-seo' )
sprintf( __( '%1$s Meta Box', 'wordpress-seo' ), 'Yoast SEO' )
); );
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
......
...@@ -28,8 +28,8 @@ $yform->show_hide_switch( ...@@ -28,8 +28,8 @@ $yform->show_hide_switch(
$yform->show_hide_switch( $yform->show_hide_switch(
'display-metabox-pt-' . $wpseo_post_type->name, 'display-metabox-pt-' . $wpseo_post_type->name,
/* translators: %1$s expands to Yoast SEO */ /* translators: %s expands to an indexable object's name, like a post type or taxonomy */
sprintf( __( '%1$s Meta Box', 'wordpress-seo' ), 'Yoast SEO' ) sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), '<strong>' . $wpseo_post_type->labels->name . '</strong>' )
); );
$editor = new WPSEO_Replacevar_Editor( $editor = new WPSEO_Replacevar_Editor(
......
...@@ -48,8 +48,11 @@ $editor = new WPSEO_Replacevar_Editor( ...@@ -48,8 +48,11 @@ $editor = new WPSEO_Replacevar_Editor(
$editor->render(); $editor->render();
if ( $wpseo_taxonomy->name !== 'post_format' ) { if ( $wpseo_taxonomy->name !== 'post_format' ) {
/* translators: %1$s expands to Yoast SEO */ $yform->show_hide_switch(
$yform->show_hide_switch( 'display-metabox-tax-' . $wpseo_taxonomy->name, sprintf( __( '%1$s Meta Box', 'wordpress-seo' ), 'Yoast SEO' ) ); 'display-metabox-tax-' . $wpseo_taxonomy->name,
/* translators: %s expands to an indexable object's name, like a post type or taxonomy */
sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), '<strong>' . $title . '</strong>' )
);
} }
/** /**
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Yoast\WP\SEO\Composer; namespace Yoast\WP\SEO\Composer;
use Composer\Script\Event; use Composer\Script\Event;
use Exception;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Yoast\WP\SEO\Dependency_Injection\Container_Compiler; use Yoast\WP\SEO\Dependency_Injection\Container_Compiler;
...@@ -134,4 +135,87 @@ class Actions { ...@@ -134,4 +135,87 @@ class Actions {
\system( 'composer check-cs -- ' . \implode( ' ', \array_map( 'escapeshellarg', $files ) ) ); \system( 'composer check-cs -- ' . \implode( ' ', \array_map( 'escapeshellarg', $files ) ) );
} }
/**
* Generates a migration.
*
* @param Event $event Composer event that triggered this script.
*
* @return void
*
* @throws Exception If no migration name is provided.
*/
public static function generate_migration( Event $event ) {
$args = $event->getArguments();
if ( empty( $args[0] ) ) {
throw new Exception( 'You must provide an argument with the migration name.' );
}
$name = $args[0];
$timestamp = \gmdate( 'YmdHis', \time() );
// Camelcase the name.
$name = \preg_replace( '/\\s+/', '_', $name );
$parts = \explode( '_', $name );
$name = '';
foreach ( $parts as $word ) {
$name .= \ucfirst( $word );
}
$correct_class_name_regex = '/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/';
if ( ! \preg_match( $correct_class_name_regex, $name ) ) {
throw new Exception( "$name is not a valid migration name." );
}
if ( \class_exists( $name ) ) {
throw new Exception( "A class with the name $name already exists." );
}
$file_name = $timestamp . '_' . $name . '.php';
$template = <<<TPL
<?php
/**
* Yoast SEO Plugin File.
*
* @package Yoast\WP\SEO\Config\Migrations
*/
namespace Yoast\WP\SEO\Config\Migrations;
use Yoast\WP\Lib\Migrations\Migration;
/**
* {$name} class.
*/
class {$name} extends Migration {
/**
* The plugin this migration belongs to.
*
* @var string
*/
public static \$plugin = 'free';
/**
* Migration up.
*
* @return void
*/
public function up() {
}
/**
* Migration down.
*
* @return void
*/
public function down() {
}
}
TPL;
\file_put_contents( __DIR__ . '/../../src/config/migrations/' . $file_name, $template );
}
} }
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
namespace Yoast\WP\SEO\Dependency_Injection; namespace Yoast\WP\SEO\Dependency_Injection;
use ReflectionClass;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Definition;
use Yoast\WP\Lib\Migrations\Migration;
use Yoast\WP\SEO\Commands\Command_Interface; use Yoast\WP\SEO\Commands\Command_Interface;
use Yoast\WP\SEO\Initializers\Initializer_Interface; use Yoast\WP\SEO\Initializers\Initializer_Interface;
use Yoast\WP\SEO\Integrations\Integration_Interface; use Yoast\WP\SEO\Integrations\Integration_Interface;
...@@ -67,5 +69,14 @@ class Loader_Pass implements CompilerPassInterface { ...@@ -67,5 +69,14 @@ class Loader_Pass implements CompilerPassInterface {
if ( \is_subclass_of( $class, Command_Interface::class ) ) { if ( \is_subclass_of( $class, Command_Interface::class ) ) {
$loader_definition->addMethodCall( 'register_command', [ $class ] ); $loader_definition->addMethodCall( 'register_command', [ $class ] );
} }
if ( \is_subclass_of( $class, Migration::class ) ) {
$reflect = new ReflectionClass( $class );
$path = $reflect->getFileName();
$file = \basename( $path, '.php' );
$version = \explode( '_', $file )[0];
$plugin = $class::$plugin;
$loader_definition->addMethodCall( 'register_migration', [ $plugin, $version, $class ] );
}
} }
} }
...@@ -12,11 +12,13 @@ use WPSEO_Admin_Asset_Manager; ...@@ -12,11 +12,13 @@ use WPSEO_Admin_Asset_Manager;
use WPSEO_Breadcrumbs; use WPSEO_Breadcrumbs;
use WPSEO_Frontend; use WPSEO_Frontend;
use WPSEO_Replace_Vars; use WPSEO_Replace_Vars;
use Yoast\WP\Lib\Migrations\Adapter;
use Yoast\WP\SEO\WordPress\Wrapper; use Yoast\WP\SEO\WordPress\Wrapper;
use YoastSEO_Vendor\Symfony\Component\DependencyInjection\ContainerInterface; use YoastSEO_Vendor\Symfony\Component\DependencyInjection\ContainerInterface;
/* @var $container \Symfony\Component\DependencyInjection\ContainerBuilder */ /**
* @var $container \Symfony\Component\DependencyInjection\ContainerBuilder
*/
// WordPress factory functions. // WordPress factory functions.
$container->register( 'wpdb', 'wpdb' )->setFactory( [ Wrapper::class, 'get_wpdb' ] ); $container->register( 'wpdb', 'wpdb' )->setFactory( [ Wrapper::class, 'get_wpdb' ] );
...@@ -31,6 +33,9 @@ $container->register( WPSEO_Frontend::class, WPSEO_Frontend::class )->setAutowir ...@@ -31,6 +33,9 @@ $container->register( WPSEO_Frontend::class, WPSEO_Frontend::class )->setAutowir
// The container itself. // The container itself.
$container->setAlias( ContainerInterface::class, 'service_container' ); $container->setAlias( ContainerInterface::class, 'service_container' );
// Required for the migrations framework.
$container->register( Adapter::class, Adapter::class )->setAutowired( true )->setPublic( true );
$excluded_files = [ $excluded_files = [
'main.php', 'main.php',
]; ];
...@@ -44,7 +49,6 @@ $excluded_directories = [ ...@@ -44,7 +49,6 @@ $excluded_directories = [
'backwards-compatibility', 'backwards-compatibility',
'surfaces/values', 'surfaces/values',
'presenters', 'presenters',
'config/migrations',
]; ];
$excluded = \implode( ',', \array_merge( $excluded_directories, $excluded_files ) ); $excluded = \implode( ',', \array_merge( $excluded_directories, $excluded_files ) );
...@@ -56,7 +60,9 @@ $base_definition ...@@ -56,7 +60,9 @@ $base_definition
->setAutoconfigured( true ) ->setAutoconfigured( true )
->setPublic( true ); ->setPublic( true );
/* @var $loader \Yoast\WP\SEO\Dependency_Injection\Custom_Loader */ /**
* @var $loader \Yoast\WP\SEO\Dependency_Injection\Custom_Loader
*/
$loader->registerClasses( $base_definition, 'Yoast\\WP\\SEO\\', 'src/*', 'src/{' . $excluded . '}' ); $loader->registerClasses( $base_definition, 'Yoast\\WP\\SEO\\', 'src/*', 'src/{' . $excluded . '}' );
if ( \file_exists( __DIR__ . '/../../premium/config/dependency-injection/services.php' ) ) { if ( \file_exists( __DIR__ . '/../../premium/config/dependency-injection/services.php' ) ) {
......
<?php
declare( strict_types=1 );
use Isolated\Symfony\Component\Finder\Finder;
return array(
/*
* By default when running php-scoper add-prefix, it will prefix all relevant code found in the current working
* directory. You can however define which files should be scoped by defining a collection of Finders in the
* following configuration key.
*
* For more see: https://github.com/humbug/php-scoper#finders-and-paths
*/
'finders' => array(
Finder::create()->files()->in( 'vendor/ruckusing/ruckusing-migrations' )
->exclude( [ 'config', 'tests', 'lib/Task/Hello' ] )
->name( [ '*.php', 'LICENSE', 'composer.json' ] ),
),
/*
* When scoping PHP files, there will be scenarios where some of the code being scoped indirectly references the
* original namespace. These will include, for example, strings or string manipulations. PHP-Scoper has limited
* support for prefixing such strings. To circumvent that, you can define patchers to manipulate the file to your
* heart contents.
*
* For more see: https://github.com/humbug/php-scoper#patchers
*/
'patchers' => array(
/**
* 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 ) {
if ( substr( $file_path, -33 ) !== 'lib/Ruckusing/FrameworkRunner.php' ) {
return $content;
}
$replaced = preg_replace(
'/\$adapter_class = "Ruckusing_Adapter_(MySQL|PgSQL|Sqlite3)_Base"/',
sprintf( '$adapter_class = "\%s\Ruckusing_Adapter_\\1_Base"', $prefix ),
$content
);
$replaced = str_replace(
"\set_error_handler(array('Ruckusing_Exception', 'errorHandler'), \E_ALL);",
sprintf( '\set_error_handler(array(\'\%s\Ruckusing_Exception\', \'errorHandler\'), \E_ALL);', $prefix ),
$replaced
);
$replaced = str_replace(
"\set_exception_handler(array('Ruckusing_Exception', 'exceptionHandler'));",
sprintf( '\set_exception_handler(array(\'\%s\Ruckusing_Exception\', \'exceptionHandler\'));', $prefix ),
$replaced
);
return $replaced;
},
/**
* Replaces a string reference to a class with the prefixed version.
*
* @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 ) {
if ( substr( $file_path, -27 ) !== 'Ruckusing/Util/Migrator.php' ) {
return $content;
}
$replaced = str_replace(
'"Ruckusing_Util_Migrator"',
sprintf( '"\%s\Ruckusing_Util_Migrator"', $prefix ),
$content
);
return $replaced;
},
/**
* Prefixes the Namespace prefix define.
*
* @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 ) {
if ( substr( $file_path, -25 ) !== 'Ruckusing/Util/Naming.php' ) {
return $content;
}
$replaced = str_replace(
'const CLASS_NS_PREFIX = \'Task_\'',
sprintf( 'const CLASS_NS_PREFIX = \'\%s\Task_\'', $prefix ),
$content
);
return $replaced;
},
/**
* Escapes the namespace for use in a regex match.
*
* @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 ) {
if ( substr( $file_path, -25 ) !== 'Ruckusing/Util/Naming.php' ) {
return $content;
}
$replaced = str_replace(
'preg_match(\'/\' . self::CLASS_NS_PREFIX . \'/\'',
'preg_match(\'/\' . preg_quote(self::CLASS_NS_PREFIX) . \'/\'',
$content
);
return $replaced;
},
),
/*
* 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.
*
* https://github.com/humbug/php-scoper#whitelist
*/
'whitelist-global-constants' => false,
'whitelist-global-classes' => false,
'whitelist' => [ 'FALSE', 'NULL' ],
);
This diff is collapsed.
...@@ -676,4 +676,29 @@ ul.wpseo-metabox-tabs li.wpseo-tab-add-keyword { ...@@ -676,4 +676,29 @@ ul.wpseo-metabox-tabs li.wpseo-tab-add-keyword {
align-items: center; align-items: center;
} }
.yoast-seo-sidebar-panel div {
line-height: 2;
}
.yoast-seo-sidebar-panel div svg {
vertical-align: middle;
}
ul.yoast-seo-social-share-buttons li {
display: inline-block;
margin-right: 8px;
width: 32px;
height: 32px;
}
ul.yoast-seo-social-share-buttons svg {
width: 32px;
height: 32px;
}
ul.yoast-seo-social-share-buttons a {
width: 32px;
height: 32px;
display: inline-block;
}
/*# sourceMappingURL=metabox.css.map */ /*# sourceMappingURL=metabox.css.map */
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Frontend\Schema
*/
use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Generators\Schema\Abstract_Schema_Piece;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
use Yoast\WP\SEO\Surfaces\Helpers_Surface;
/**
* Returns schema Article data.
*
* @deprecated 14.0
*
* @since 10.2
*/
abstract class WPSEO_Deprecated_Graph_Piece implements WPSEO_Graph_Piece {
/**
* The meta tags context.
*
* @var Meta_Tags_Context
*/
private $context;
/**
* The helpers surface.
*
* @var Helpers_Surface
*/
public $helpers;
/**
* The date helper.
*
* @var WPSEO_Date_Helper
*/
protected $date;
/**
* The new stable piece.
*
* @var Abstract_Schema_Piece
*/
protected $stable;
/**
* The stable class name.
*
* @var string
*/
protected $stable_class_name;
/**
* WPSEO_Schema_Article constructor.
*
* @param string $class_name The class name.
*
* @codeCoverageIgnore
* @deprecated 14.0
*/
public function __construct( $class_name ) {
$this->stable_class_name = $class_name;
$this->stable = new $class_name();
_deprecated_function( __METHOD__, 'WPSEO 14.0', $this->stable_class_name );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
// We cannot extend the stable graph piece because a property was made public on it that was previously private.
// So instead, we instantiate a stable graph piece and delegate to it.
$this->context = $memoizer->for_current_page();
$this->stable->context = $this->context;
$this->helpers = YoastSEO()->helpers;
$this->stable->helpers = $this->helpers;
}
/**
* Determines whether or not a piece should be added to the graph.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', $this->stable_class_name . '::is_needed' );
return $this->stable->is_needed();
}
/**
* Returns Article data.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return array $data Article data.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', $this->stable_class_name . '::generate' );
return $this->stable->generate();
}
}
...@@ -63,7 +63,7 @@ class WPSEO_OpenGraph { ...@@ -63,7 +63,7 @@ class WPSEO_OpenGraph {
/** /**
* Outputs the site owner. * Outputs the site owner.
* *
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @return void * @return void
* *
...@@ -95,7 +95,7 @@ class WPSEO_OpenGraph { ...@@ -95,7 +95,7 @@ class WPSEO_OpenGraph {
* @deprecated 14.0 * @deprecated 14.0
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @return boolean * @return boolean
*/ */
...@@ -111,7 +111,7 @@ class WPSEO_OpenGraph { ...@@ -111,7 +111,7 @@ class WPSEO_OpenGraph {
* @deprecated 14.0 * @deprecated 14.0
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @param bool $echo Whether or not to echo the output. * @param bool $echo Whether or not to echo the output.
* *
...@@ -146,7 +146,7 @@ class WPSEO_OpenGraph { ...@@ -146,7 +146,7 @@ class WPSEO_OpenGraph {
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @link https://developers.facebook.com/blog/post/2013/06/19/platform-updates--new-open-graph-tags-for-media-publishers-and-more/ * @link https://developers.facebook.com/blog/post/2013/06/19/platform-updates--new-open-graph-tags-for-media-publishers-and-more/
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @return boolean * @return boolean
*/ */
...@@ -163,7 +163,7 @@ class WPSEO_OpenGraph { ...@@ -163,7 +163,7 @@ class WPSEO_OpenGraph {
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @link https://developers.facebook.com/blog/post/2013/06/19/platform-updates--new-open-graph-tags-for-media-publishers-and-more/ * @link https://developers.facebook.com/blog/post/2013/06/19/platform-updates--new-open-graph-tags-for-media-publishers-and-more/
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @return boolean * @return boolean
*/ */
...@@ -197,8 +197,8 @@ class WPSEO_OpenGraph { ...@@ -197,8 +197,8 @@ class WPSEO_OpenGraph {
* @deprecated 14.0 * @deprecated 14.0
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @link http://www.facebook.com/translations/FacebookLocales.xml for the list of supported locales. * @link https://developers.facebook.com/docs/internationalization/#locales for the list of supported locales.
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @param bool $echo Whether to echo or return the locale. * @param bool $echo Whether to echo or return the locale.
* *
...@@ -244,7 +244,7 @@ class WPSEO_OpenGraph { ...@@ -244,7 +244,7 @@ class WPSEO_OpenGraph {
* @deprecated 14.0 * @deprecated 14.0
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @return boolean; * @return boolean;
*/ */
...@@ -286,7 +286,7 @@ class WPSEO_OpenGraph { ...@@ -286,7 +286,7 @@ class WPSEO_OpenGraph {
* @deprecated 14.0 * @deprecated 14.0
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @return boolean * @return boolean
*/ */
...@@ -302,7 +302,7 @@ class WPSEO_OpenGraph { ...@@ -302,7 +302,7 @@ class WPSEO_OpenGraph {
* @deprecated 14.0 * @deprecated 14.0
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @link https://developers.facebook.com/docs/reference/opengraph/object-type/article/ * @link https://ogp.me/#type_article
* *
* @return boolean; * @return boolean;
*/ */
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Yoast\WP\SEO\Generators\Schema\Article; use Yoast\WP\SEO\Generators\Schema\Article;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns schema Article data. * Returns schema Article data.
...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 10.2 * @since 10.2
*/ */
class WPSEO_Schema_Article extends Article implements WPSEO_Graph_Piece { class WPSEO_Schema_Article extends WPSEO_Deprecated_Graph_Piece {
/** /**
* The date helper. * The date helper.
...@@ -33,42 +32,11 @@ class WPSEO_Schema_Article extends Article implements WPSEO_Graph_Piece { ...@@ -33,42 +32,11 @@ class WPSEO_Schema_Article extends Article implements WPSEO_Graph_Piece {
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Article' ); parent::__construct( Article::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
$this->date = new WPSEO_Date_Helper(); $this->date = new WPSEO_Date_Helper();
} }
/**
* Determines whether or not a piece should be added to the graph.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Article::is_needed' );
return parent::is_needed();
}
/**
* Returns Article data.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return array $data Article data.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Article::generate' );
return parent::generate();
}
/** /**
* Determines whether a given post type should have Article schema. * Determines whether a given post type should have Article schema.
* *
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
use Yoast\WP\SEO\Config\Schema_IDs; use Yoast\WP\SEO\Config\Schema_IDs;
use Yoast\WP\SEO\Generators\Schema\Author; use Yoast\WP\SEO\Generators\Schema\Author;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns schema Person data. * Returns schema Person data.
...@@ -16,7 +15,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -16,7 +15,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 10.2 * @since 10.2
*/ */
class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece { class WPSEO_Schema_Author extends WPSEO_Deprecated_Graph_Piece {
/** /**
* The hash used for images. * The hash used for images.
...@@ -41,11 +40,7 @@ class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece { ...@@ -41,11 +40,7 @@ class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece {
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Author' ); parent::__construct( Author::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
} }
/** /**
...@@ -59,15 +54,15 @@ class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece { ...@@ -59,15 +54,15 @@ class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece {
public function is_needed() { public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Author::is_needed' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Author::is_needed' );
if ( $this->context->indexable->object_type === 'user' ) { if ( $this->stable->context->indexable->object_type === 'user' ) {
return true; return true;
} }
// This call to `is_post_author` is why this whole block could not be replaced with a `parent::is_needed()` call. // This call to `is_post_author` is why this whole block could not be replaced with a `parent::is_needed()` call.
if ( $this->is_post_author() ) { if ( $this->is_post_author() ) {
// If the author is the user the site represents, no need for an extra author block. // If the author is the user the site represents, no need for an extra author block.
if ( parent::is_needed() ) { if ( $this->stable->is_needed() ) {
return (int) $this->context->post->post_author !== $this->context->site_user_id; return (int) $this->stable->context->post->post_author !== $this->stable->context->site_user_id;
} }
return true; return true;
...@@ -76,20 +71,6 @@ class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece { ...@@ -76,20 +71,6 @@ class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece {
return false; return false;
} }
/**
* Returns Person Schema data.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool|array Person data on success, false on failure.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Author::generate' );
return parent::generate();
}
/** /**
* Gets the Schema type we use for this class. * Gets the Schema type we use for this class.
* *
...@@ -116,8 +97,8 @@ class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece { ...@@ -116,8 +97,8 @@ class WPSEO_Schema_Author extends Author implements WPSEO_Graph_Piece {
_deprecated_function( __METHOD__, 'WPSEO 14.0' ); _deprecated_function( __METHOD__, 'WPSEO 14.0' );
return ( return (
$this->context->indexable->object_type === 'post' $this->stable->context->indexable->object_type === 'post'
&& $this->helpers->schema->article->is_article_post_type( $this->context->indexable->object_sub_type ) && $this->helpers->schema->article->is_article_post_type( $this->stable->context->indexable->object_sub_type )
); );
} }
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Yoast\WP\SEO\Generators\Schema\Breadcrumb; use Yoast\WP\SEO\Generators\Schema\Breadcrumb;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns schema Breadcrumb data. * Returns schema Breadcrumb data.
...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 10.2 * @since 10.2
*/ */
class WPSEO_Schema_Breadcrumb extends Breadcrumb implements WPSEO_Graph_Piece { class WPSEO_Schema_Breadcrumb extends WPSEO_Deprecated_Graph_Piece {
/** /**
* WPSEO_Schema_Breadcrumb constructor. * WPSEO_Schema_Breadcrumb constructor.
...@@ -26,40 +25,6 @@ class WPSEO_Schema_Breadcrumb extends Breadcrumb implements WPSEO_Graph_Piece { ...@@ -26,40 +25,6 @@ class WPSEO_Schema_Breadcrumb extends Breadcrumb implements WPSEO_Graph_Piece {
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Breadcrumb' ); parent::__construct( Breadcrumb::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
}
/**
* Determine if we should add a breadcrumb attribute.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Breadcrumb::is_needed' );
return parent::is_needed();
}
/**
* Returns Schema breadcrumb data to allow recognition of page's position in the site hierarchy.
*
* @link https://developers.google.com/search/docs/data-types/breadcrumb
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool|array Array on success, false on failure.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Breadcrumb::generate' );
return parent::generate();
} }
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Yoast\WP\SEO\Generators\Schema\FAQ; use Yoast\WP\SEO\Generators\Schema\FAQ;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns schema FAQ data. * Returns schema FAQ data.
...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 11.3 * @since 11.3
*/ */
class WPSEO_Schema_FAQ extends FAQ implements WPSEO_Graph_Piece { class WPSEO_Schema_FAQ extends WPSEO_Deprecated_Graph_Piece {
/** /**
* WPSEO_Schema_FAQ constructor. * WPSEO_Schema_FAQ constructor.
...@@ -26,11 +25,7 @@ class WPSEO_Schema_FAQ extends FAQ implements WPSEO_Graph_Piece { ...@@ -26,11 +25,7 @@ class WPSEO_Schema_FAQ extends FAQ implements WPSEO_Graph_Piece {
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\FAQ' ); parent::__construct( FAQ::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
} }
/** /**
...@@ -66,20 +61,6 @@ class WPSEO_Schema_FAQ extends FAQ implements WPSEO_Graph_Piece { ...@@ -66,20 +61,6 @@ class WPSEO_Schema_FAQ extends FAQ implements WPSEO_Graph_Piece {
return $page_type; return $page_type;
} }
/**
* Render a list of questions, referencing them by ID.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return array $data Our Schema graph.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\FAQ::generate' );
return parent::generate();
}
/** /**
* Add the Questions in our FAQ blocks as separate pieces to the graph. * Add the Questions in our FAQ blocks as separate pieces to the graph.
* *
...@@ -97,18 +78,4 @@ class WPSEO_Schema_FAQ extends FAQ implements WPSEO_Graph_Piece { ...@@ -97,18 +78,4 @@ class WPSEO_Schema_FAQ extends FAQ implements WPSEO_Graph_Piece {
return []; return [];
} }
/**
* Determines whether or not a piece should be added to the graph.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\FAQ::is_needed' );
return parent::is_needed();
}
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Yoast\WP\SEO\Generators\Schema\HowTo; use Yoast\WP\SEO\Generators\Schema\HowTo;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns schema FAQ data. * Returns schema FAQ data.
...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 11.5 * @since 11.5
*/ */
class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece { class WPSEO_Schema_HowTo extends WPSEO_Deprecated_Graph_Piece {
/** /**
* The HowTo blocks count on the current page. * The HowTo blocks count on the current page.
...@@ -33,25 +32,7 @@ class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece { ...@@ -33,25 +32,7 @@ class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece {
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\HowTo' ); parent::__construct( HowTo::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
}
/**
* Renders a list of questions, referencing them by ID.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return array $data Our Schema graph.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\HowTo::generate' );
return parent::generate();
} }
/** /**
...@@ -75,17 +56,113 @@ class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece { ...@@ -75,17 +56,113 @@ class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece {
} }
/** /**
* Determines whether or not a piece should be added to the graph. * Generates the HowTo schema for a block.
* *
* @codeCoverageIgnore * @param array $graph Our Schema data.
* @deprecated 14.0 * @param array $block The How-To block content.
* @param int $index The index of the current block.
*/
protected function add_how_to( &$graph, $block, $index ) {
$data = [
'@type' => 'HowTo',
'@id' => $this->stable->context->canonical . '#howto-' . ( $index + 1 ),
'name' => $this->helpers->schema->html->smart_strip_tags( $this->helpers->post->get_post_title_with_fallback( $this->stable->context->id ) ),
'mainEntityOfPage' => [ '@id' => $this->stable->context->main_schema_id ],
'description' => '',
];
if ( isset( $block['attrs']['jsonDescription'] ) ) {
$data['description'] = $this->helpers->schema->html->sanitize( $block['attrs']['jsonDescription'] );
}
$this->add_duration( $data, $block['attrs'] );
$this->add_steps( $data, $block['attrs']['steps'] );
$data = $this->helpers->schema->language->add_piece_language( $data );
$graph[] = $data;
}
/**
* Adds the steps to our How-To output.
*
* @param array $data Our How-To schema data.
* @param array $steps Our How-To block's steps.
*/
private function add_steps( &$data, $steps ) {
foreach ( $steps as $step ) {
$schema_id = $this->stable->context->canonical . '#' . \esc_attr( $step['id'] );
$schema_step = [
'@type' => 'HowToStep',
'url' => $schema_id,
];
if ( isset( $step['jsonText'] ) ) {
$json_text = $this->helpers->schema->html->sanitize( $step['jsonText'] );
}
if ( isset( $step['jsonName'] ) ) {
$json_name = $this->helpers->schema->html->smart_strip_tags( $step['jsonName'] );
}
if ( empty( $json_name ) ) {
if ( empty( $step['text'] ) ) {
continue;
}
$schema_step['text'] = '';
$this->add_step_image( $schema_step, $step );
// If there is no text and no image, don't output the step.
if ( empty( $json_text ) && empty( $schema_step['image'] ) ) {
continue;
}
if ( ! empty( $json_text ) ) {
$schema_step['text'] = $json_text;
}
}
elseif ( empty( $json_text ) ) {
$schema_step['text'] = $json_name;
}
else {
$schema_step['name'] = $json_name;
$schema_step['itemListElement'] = [
[
'@type' => 'HowToDirection',
'text' => $json_text,
],
];
$this->add_step_description( $schema_step, $json_text );
$this->add_step_image( $schema_step, $step );
}
$data['step'][] = $schema_step;
}
}
/**
* Adds the duration of the task to the Schema.
* *
* @return bool * @param array $data Our How-To schema data.
* @param array $attributes The block data attributes.
*/ */
public function is_needed() { private function add_duration( &$data, $attributes ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\HowTo::is_needed' ); if ( empty( $attributes['hasDuration'] ) ) {
return;
}
return parent::is_needed(); $days = empty( $attributes['days'] ) ? 0 : $attributes['days'];
$hours = empty( $attributes['hours'] ) ? 0 : $attributes['hours'];
$minutes = empty( $attributes['minutes'] ) ? 0 : $attributes['minutes'];
if ( ( $days + $hours + $minutes ) > 0 ) {
$data['totalTime'] = \esc_attr( 'P' . $days . 'DT' . $hours . 'H' . $minutes . 'M' );
}
} }
/** /**
...@@ -99,7 +176,36 @@ class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece { ...@@ -99,7 +176,36 @@ class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece {
protected function get_main_schema_id() { protected function get_main_schema_id() {
_deprecated_function( __METHOD__, 'WPSEO 14.0' ); _deprecated_function( __METHOD__, 'WPSEO 14.0' );
return $this->context->main_schema_id; return $this->stable->context->main_schema_id;
}
/**
* Checks if we have a step description, if we do, add it.
*
* @param array $schema_step Our Schema output for the Step.
* @param string $json_text The step text.
*/
private function add_step_description( &$schema_step, $json_text ) {
$schema_step['itemListElement'] = [
[
'@type' => 'HowToDirection',
'text' => $json_text,
],
];
}
/**
* Checks if we have a step image, if we do, add it.
*
* @param array $schema_step Our Schema output for the Step.
* @param array $step The step block data.
*/
private function add_step_image( &$schema_step, $step ) {
foreach ( $step['text'] as $line ) {
if ( \is_array( $line ) && isset( $line['type'] ) && $line['type'] === 'img' ) {
$schema_step['image'] = $this->get_image_schema( \esc_url( $line['props']['src'] ) );
}
}
} }
/** /**
...@@ -117,6 +223,8 @@ class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece { ...@@ -117,6 +223,8 @@ class WPSEO_Schema_HowTo extends HowTo implements WPSEO_Graph_Piece {
protected function get_image_schema( $url ) { protected function get_image_schema( $url ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\HowTo::get_image_schema' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\HowTo::get_image_schema' );
return parent::get_image_schema( $url ); $schema_id = $this->stable->context->canonical . '#schema-image-' . \md5( $url );
return $this->helpers->schema->image->generate_from_url( $schema_id, $url );
} }
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Yoast\WP\SEO\Generators\Schema\Main_Image; use Yoast\WP\SEO\Generators\Schema\Main_Image;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns ImageObject schema data. * Returns ImageObject schema data.
...@@ -16,7 +15,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -16,7 +15,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 11.5 * @since 11.5
*/ */
class WPSEO_Schema_MainImage extends Main_Image implements WPSEO_Graph_Piece { class WPSEO_Schema_MainImage extends WPSEO_Deprecated_Graph_Piece {
/** /**
* WPSEO_Schema_WebPage constructor. * WPSEO_Schema_WebPage constructor.
...@@ -27,41 +26,7 @@ class WPSEO_Schema_MainImage extends Main_Image implements WPSEO_Graph_Piece { ...@@ -27,41 +26,7 @@ class WPSEO_Schema_MainImage extends Main_Image implements WPSEO_Graph_Piece {
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Main_Image' ); parent::__construct( Main_Image::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
}
/**
* Determines whether or not a piece should be added to the graph.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Main_Image::is_needed' );
return parent::is_needed();
}
/**
* Adds a main image for the current URL to the schema if there is one.
*
* This can be either the featured image, or fall back to the first image in the content of the page.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return false|array $data Image Schema.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Main_Image::generate' );
return parent::generate();
} }
/** /**
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Yoast\WP\SEO\Generators\Schema\Organization; use Yoast\WP\SEO\Generators\Schema\Organization;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns schema Organization data. * Returns schema Organization data.
...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 10.2 * @since 10.2
*/ */
class WPSEO_Schema_Organization extends Organization implements WPSEO_Graph_Piece { class WPSEO_Schema_Organization extends WPSEO_Deprecated_Graph_Piece {
/** /**
* WPSEO_Schema_Organization constructor. * WPSEO_Schema_Organization constructor.
...@@ -26,38 +25,6 @@ class WPSEO_Schema_Organization extends Organization implements WPSEO_Graph_Piec ...@@ -26,38 +25,6 @@ class WPSEO_Schema_Organization extends Organization implements WPSEO_Graph_Piec
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Organization' ); parent::__construct( Organization::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
}
/**
* Determines whether an Organization graph piece should be added.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Organization::is_needed' );
return parent::is_needed();
}
/**
* Returns the Organization Schema data.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return array $data The Organization schema.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Organization::generate' );
return parent::generate();
} }
} }
...@@ -16,7 +16,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -16,7 +16,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 10.2 * @since 10.2
*/ */
class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece { class WPSEO_Schema_Person extends WPSEO_Deprecated_Graph_Piece {
/** /**
* The hash used for images. * The hash used for images.
...@@ -26,47 +26,33 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece { ...@@ -26,47 +26,33 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece {
protected $image_hash = Schema_IDs::PERSON_LOGO_HASH; protected $image_hash = Schema_IDs::PERSON_LOGO_HASH;
/** /**
* WPSEO_Schema_Person constructor. * Array of the social profiles we display for a Person.
*
* @param null $context The context. No longer used but present for BC.
* *
* @codeCoverageIgnore * @var string[]
* @deprecated 14.0
*/ */
public function __construct( $context = null ) { private $social_profiles = [
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person' ); 'facebook',
'instagram',
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class ); 'linkedin',
$this->context = $memoizer->for_current_page(); 'pinterest',
$this->helpers = YoastSEO()->helpers; 'twitter',
} 'myspace',
'youtube',
'soundcloud',
'tumblr',
'wikipedia',
];
/** /**
* Determine whether we should return Person schema. * WPSEO_Schema_Person constructor.
*
* @codeCoverageIgnore
* @deprecated 14.0
* *
* @return bool * @param null $context The context. No longer used but present for BC.
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::is_needed' );
return parent::is_needed();
}
/**
* Returns Person Schema data.
* *
* @codeCoverageIgnore * @codeCoverageIgnore
* @deprecated 14.0 * @deprecated 14.0
*
* @return bool|array Person data on success, false on failure.
*/ */
public function generate() { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::generate' ); parent::__construct( Person::class );
return parent::generate();
} }
/** /**
...@@ -80,7 +66,7 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece { ...@@ -80,7 +66,7 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece {
protected function determine_user_id() { protected function determine_user_id() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::determine_user_id' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::determine_user_id' );
return parent::determine_user_id(); return $this->stable->determine_user_id();
} }
/** /**
...@@ -96,7 +82,35 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece { ...@@ -96,7 +82,35 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece {
protected function get_social_profiles( $user_id ) { protected function get_social_profiles( $user_id ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::get_social_profiles' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::get_social_profiles' );
return parent::get_social_profiles( $user_id ); /**
* Filter: 'wpseo_schema_person_social_profiles' - Allows filtering of social profiles per user.
*
* @param int $user_id The current user we're grabbing social profiles for.
*
* @api string[] $social_profiles The array of social profiles to retrieve. Each should be a user meta field
* key. As they are retrieved using the WordPress function `get_the_author_meta`.
*/
$social_profiles = \apply_filters( 'wpseo_schema_person_social_profiles', $this->social_profiles, $user_id );
$output = [];
// We can only handle an array.
if ( ! \is_array( $social_profiles ) ) {
return $output;
}
foreach ( $social_profiles as $profile ) {
// Skip non-string values.
if ( ! \is_string( $profile ) ) {
continue;
}
$social_url = $this->url_social_site( $profile, $user_id );
if ( $social_url ) {
$output[] = $social_url;
}
}
return $output;
} }
/** /**
...@@ -112,7 +126,7 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece { ...@@ -112,7 +126,7 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece {
protected function build_person_data( $user_id ) { protected function build_person_data( $user_id ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::build_person_data' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::build_person_data' );
return parent::build_person_data( $user_id ); return $this->stable->build_person_data( $user_id );
} }
/** /**
...@@ -129,7 +143,7 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece { ...@@ -129,7 +143,7 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece {
protected function add_image( $data, $user_data ) { protected function add_image( $data, $user_data ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::add_image' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::add_image' );
return parent::add_image( $data, $user_data ); return $this->stable->add_image( $data, $user_data );
} }
/** /**
...@@ -146,6 +160,12 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece { ...@@ -146,6 +160,12 @@ class WPSEO_Schema_Person extends Person implements WPSEO_Graph_Piece {
protected function url_social_site( $social_site, $user_id = false ) { protected function url_social_site( $social_site, $user_id = false ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::url_social_site' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::url_social_site' );
return parent::url_social_site( $social_site, $user_id ); $url = \get_the_author_meta( $social_site, $user_id );
if ( ! empty( $url ) && $social_site === 'twitter' ) {
$url = 'https://twitter.com/' . $url;
}
return $url;
} }
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Yoast\WP\SEO\Generators\Schema\WebPage; use Yoast\WP\SEO\Generators\Schema\WebPage;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns schema WebPage data. * Returns schema WebPage data.
...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 10.2 * @since 10.2
*/ */
class WPSEO_Schema_WebPage extends WebPage implements WPSEO_Graph_Piece { class WPSEO_Schema_WebPage extends WPSEO_Deprecated_Graph_Piece {
/** /**
* The date helper. * The date helper.
...@@ -33,42 +32,11 @@ class WPSEO_Schema_WebPage extends WebPage implements WPSEO_Graph_Piece { ...@@ -33,42 +32,11 @@ class WPSEO_Schema_WebPage extends WebPage implements WPSEO_Graph_Piece {
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage' ); parent::__construct( WebPage::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
$this->date = new WPSEO_Date_Helper(); $this->date = new WPSEO_Date_Helper();
} }
/**
* Determines whether or not a piece should be added to the graph.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::is_needed' );
return parent::is_needed();
}
/**
* Returns WebPage schema data.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return array WebPage schema data.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::generate' );
return parent::generate();
}
/** /**
* Adds an author property to the $data if the WebPage is not represented. * Adds an author property to the $data if the WebPage is not represented.
* *
...@@ -83,7 +51,7 @@ class WPSEO_Schema_WebPage extends WebPage implements WPSEO_Graph_Piece { ...@@ -83,7 +51,7 @@ class WPSEO_Schema_WebPage extends WebPage implements WPSEO_Graph_Piece {
public function add_author( $data, $post ) { public function add_author( $data, $post ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::add_author' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::add_author' );
return parent::add_author( $data, $post ); return $this->stable->add_author( $data, $post );
} }
/** /**
...@@ -97,6 +65,6 @@ class WPSEO_Schema_WebPage extends WebPage implements WPSEO_Graph_Piece { ...@@ -97,6 +65,6 @@ class WPSEO_Schema_WebPage extends WebPage implements WPSEO_Graph_Piece {
public function add_image( &$data ) { public function add_image( &$data ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::add_image' ); _deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::add_image' );
parent::add_image( $data ); $this->stable->add_image( $data );
} }
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Yoast\WP\SEO\Generators\Schema\Website; use Yoast\WP\SEO\Generators\Schema\Website;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
/** /**
* Returns schema Website data. * Returns schema Website data.
...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; ...@@ -15,7 +14,7 @@ use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
* *
* @since 10.2 * @since 10.2
*/ */
class WPSEO_Schema_Website extends Website implements WPSEO_Graph_Piece { class WPSEO_Schema_Website extends WPSEO_Deprecated_Graph_Piece {
/** /**
* WPSEO_Schema_Website constructor. * WPSEO_Schema_Website constructor.
...@@ -26,42 +25,6 @@ class WPSEO_Schema_Website extends Website implements WPSEO_Graph_Piece { ...@@ -26,42 +25,6 @@ class WPSEO_Schema_Website extends Website implements WPSEO_Graph_Piece {
* @deprecated 14.0 * @deprecated 14.0
*/ */
public function __construct( $context = null ) { public function __construct( $context = null ) {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Website' ); parent::__construct( Website::class );
$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
$this->context = $memoizer->for_current_page();
$this->helpers = YoastSEO()->helpers;
}
/**
* Determines whether or not a piece should be added to the graph.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @return bool
*/
public function is_needed() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Website::is_needed' );
return parent::is_needed();
}
/**
* Outputs code to allow recognition of the internal search engine.
*
* @codeCoverageIgnore
* @deprecated 14.0
*
* @since 1.5.7
*
* @link https://developers.google.com/structured-data/site-name
*
* @return array Website data blob.
*/
public function generate() {
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Website::generate' );
return parent::generate();
} }
} }
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1600" role="img" aria-hidden="true" focusable="false"><g fill="none" fill-rule="evenodd"><path fill="#1877f2" d="M1600 800a800 800 0 1 0-925 790v-559H472V800h203V624c0-201 119-311 302-311 88 0 179 15 179 15v197h-101c-99 0-130 62-130 125v150h222l-36 231H925v559a800 800 0 0 0 675-790"/><path fill="#fff" d="M1147 800H925V650c0-63 31-125 130-125h101V328s-91-15-179-15c-183 0-302 110-302 311v176H472v231h203v559a806 806 0 0 0 250 0v-559h186z"/></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" role="img" aria-hidden="true" focusable="false"><circle cx="200" cy="200" r="200" fill="#1da1f2"/><path d="M163.4 305.5c88.7 0 137.2-73.5 137.2-137.2 0-2.1 0-4.2-.1-6.2 9.4-6.8 17.6-15.3 24.1-25-8.6 3.8-17.9 6.4-27.7 7.6 10-6 17.6-15.4 21.2-26.7-9.3 5.5-19.6 9.5-30.6 11.7-8.8-9.4-21.3-15.2-35.2-15.2-26.6 0-48.2 21.6-48.2 48.2 0 3.8.4 7.5 1.3 11-40.1-2-75.6-21.2-99.4-50.4-4.1 7.1-6.5 15.4-6.5 24.2 0 16.7 8.5 31.5 21.5 40.1-7.9-.2-15.3-2.4-21.8-6v.6c0 23.4 16.6 42.8 38.7 47.3-4 1.1-8.3 1.7-12.7 1.7-3.1 0-6.1-.3-9.1-.9 6.1 19.2 23.9 33.1 45 33.5-16.5 12.9-37.3 20.6-59.9 20.6-3.9 0-7.7-.2-11.5-.7 21.1 13.8 46.5 21.8 73.7 21.8" fill="#fff"/></svg>
\ No newline at end of file
...@@ -332,7 +332,7 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration { ...@@ -332,7 +332,7 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
[ [
'id' => 'wpseo-facebookdebug', 'id' => 'wpseo-facebookdebug',
'title' => __( 'Facebook Debugger', 'wordpress-seo' ), 'title' => __( 'Facebook Debugger', 'wordpress-seo' ),
'href' => '//developers.facebook.com/tools/debug/og/object?q=' . $encoded_url, 'href' => '//developers.facebook.com/tools/debug/?q=' . $encoded_url,
], ],
[ [
'id' => 'wpseo-pinterestvalidator', 'id' => 'wpseo-pinterestvalidator',
......
...@@ -24,8 +24,14 @@ class WPSEO_Image_Utils { ...@@ -24,8 +24,14 @@ class WPSEO_Image_Utils {
*/ */
$url = preg_replace( '/(.*)-\d+x\d+\.(jpg|png|gif)$/', '$1.$2', $url ); $url = preg_replace( '/(.*)-\d+x\d+\.(jpg|png|gif)$/', '$1.$2', $url );
static $uploads;
if ( $uploads === null ) {
$uploads = wp_get_upload_dir();
}
// Don't try to do this for external URLs. // Don't try to do this for external URLs.
if ( strpos( $url, get_site_url() ) !== 0 ) { if ( strpos( $url, $uploads['baseurl'] ) !== 0 ) {
return 0; return 0;
} }
......
...@@ -190,7 +190,12 @@ class WPSEO_Replace_Vars { ...@@ -190,7 +190,12 @@ class WPSEO_Replace_Vars {
// Do the actual replacements. // Do the actual replacements.
if ( is_array( $replacements ) && $replacements !== [] ) { if ( is_array( $replacements ) && $replacements !== [] ) {
$string = str_replace( array_keys( $replacements ), array_values( $replacements ), $string ); $string = str_replace(
array_keys( $replacements ),
// Make sure to exclude replacement values that are arrays e.g. coming from a custom field serialized value.
array_filter( array_values( $replacements ), 'is_scalar' ),
$string
);
} }
/** /**
...@@ -313,18 +318,22 @@ class WPSEO_Replace_Vars { ...@@ -313,18 +318,22 @@ class WPSEO_Replace_Vars {
$replacement = null; $replacement = null;
if ( $this->args->post_date !== '' ) { if ( $this->args->post_date !== '' ) {
// Returns a string.
$replacement = $this->date->format_translated( $this->args->post_date, get_option( 'date_format' ) ); $replacement = $this->date->format_translated( $this->args->post_date, get_option( 'date_format' ) );
} }
else { else {
if ( get_query_var( 'day' ) && get_query_var( 'day' ) !== '' ) { if ( get_query_var( 'day' ) && get_query_var( 'day' ) !== '' ) {
// Returns a string.
$replacement = get_the_date(); $replacement = get_the_date();
} }
else { else {
if ( single_month_title( ' ', false ) && single_month_title( ' ', false ) !== '' ) { if ( single_month_title( ' ', false ) && single_month_title( ' ', false ) !== '' ) {
// Returns a string.
$replacement = single_month_title( ' ', false ); $replacement = single_month_title( ' ', false );
} }
elseif ( get_query_var( 'year' ) !== '' ) { elseif ( get_query_var( 'year' ) !== '' ) {
$replacement = get_query_var( 'year' ); // Returns an integer, let's cast to string.
$replacement = (string) get_query_var( 'year' );
} }
} }
} }
...@@ -705,8 +714,9 @@ class WPSEO_Replace_Vars { ...@@ -705,8 +714,9 @@ class WPSEO_Replace_Vars {
if ( is_string( $var ) && $var !== '' ) { if ( is_string( $var ) && $var !== '' ) {
$field = substr( $var, 3 ); $field = substr( $var, 3 );
if ( ( is_singular() || is_admin() ) && ( is_object( $post ) && isset( $post->ID ) ) ) { if ( ( is_singular() || is_admin() ) && ( is_object( $post ) && isset( $post->ID ) ) ) {
// Post meta can be arrays and in this case we need to exclude them.
$name = get_post_meta( $post->ID, $field, true ); $name = get_post_meta( $post->ID, $field, true );
if ( $name !== '' ) { if ( $name !== '' && ! is_array( $name ) ) {
$replacement = $name; $replacement = $name;
} }
} }
...@@ -900,7 +910,8 @@ class WPSEO_Replace_Vars { ...@@ -900,7 +910,8 @@ class WPSEO_Replace_Vars {
$replacement = null; $replacement = null;
if ( ! empty( $this->args->ID ) ) { if ( ! empty( $this->args->ID ) ) {
$replacement = $this->args->ID; // The post/page/cpt ID is an integer, let's cast to string.
$replacement = (string) $this->args->ID;
} }
return $replacement; return $replacement;
...@@ -929,7 +940,7 @@ class WPSEO_Replace_Vars { ...@@ -929,7 +940,7 @@ class WPSEO_Replace_Vars {
private function retrieve_name() { private function retrieve_name() {
$replacement = null; $replacement = null;
$user_id = $this->retrieve_userid(); $user_id = (int) $this->retrieve_userid();
$name = get_the_author_meta( 'display_name', $user_id ); $name = get_the_author_meta( 'display_name', $user_id );
if ( $name !== '' ) { if ( $name !== '' ) {
$replacement = $name; $replacement = $name;
...@@ -946,7 +957,7 @@ class WPSEO_Replace_Vars { ...@@ -946,7 +957,7 @@ class WPSEO_Replace_Vars {
private function retrieve_user_description() { private function retrieve_user_description() {
$replacement = null; $replacement = null;
$user_id = $this->retrieve_userid(); $user_id = (int) $this->retrieve_userid();
$description = get_the_author_meta( 'description', $user_id ); $description = get_the_author_meta( 'description', $user_id );
if ( $description !== '' ) { if ( $description !== '' ) {
$replacement = $description; $replacement = $description;
...@@ -1072,7 +1083,8 @@ class WPSEO_Replace_Vars { ...@@ -1072,7 +1083,8 @@ class WPSEO_Replace_Vars {
* @return string * @return string
*/ */
private function retrieve_userid() { private function retrieve_userid() {
$replacement = ! empty( $this->args->post_author ) ? $this->args->post_author : get_query_var( 'author' ); // The user ID is an integer, let's cast to string.
$replacement = ! empty( $this->args->post_author ) ? (string) $this->args->post_author : (string) get_query_var( 'author' );
return $replacement; return $replacement;
} }
......
...@@ -174,7 +174,6 @@ class WPSEO_Option_Social extends WPSEO_Option { ...@@ -174,7 +174,6 @@ class WPSEO_Option_Social extends WPSEO_Option {
* with the exception of underscores. * with the exception of underscores.
* *
* @link https://support.twitter.com/articles/101299-why-can-t-i-register-certain-usernames * @link https://support.twitter.com/articles/101299-why-can-t-i-register-certain-usernames
* @link https://dev.twitter.com/docs/platform-objects/users
*/ */
if ( preg_match( '`^[A-Za-z0-9_]{1,25}$`', $twitter_id ) ) { if ( preg_match( '`^[A-Za-z0-9_]{1,25}$`', $twitter_id ) ) {
$clean[ $key ] = $twitter_id; $clean[ $key ] = $twitter_id;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[14],{1:function(e,t){e.exports=window.lodash},43:function(e,t){var a,n,o="",r=function(e){e=e||"polite";var t=document.createElement("div");t.id="a11y-speak-"+e,t.className="a11y-speak-region";return t.setAttribute("style","clip: rect(1px, 1px, 1px, 1px); position: absolute; height: 1px; width: 1px; overflow: hidden; word-wrap: normal;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true"),document.querySelector("body").appendChild(t),t};!function(e){if("complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll)return e();document.addEventListener("DOMContentLoaded",e)}(function(){a=document.getElementById("a11y-speak-polite"),n=document.getElementById("a11y-speak-assertive"),null===a&&(a=r("polite")),null===n&&(n=r("assertive"))});e.exports=function(e,t){!function(){for(var e=document.querySelectorAll(".a11y-speak-region"),t=0;t<e.length;t++)e[t].textContent=""}(),e=e.replace(/<[^<>]+>/g," "),o===e&&(e+=" "),o=e,n&&"assertive"===t?n.textContent=e:a&&(a.textContent=e)}},440:function(e,t,a){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(a(43)),o=a(1);!function(){function e(e){var t=!1,a="",o=[],r=["userid","name","user_description"],i=["date"],s=["title","parent_title","excerpt","excerpt_only","caption","focuskw","pt_single","pt_plural","modified","id"],c=["term404","searchphrase"],u=["term_title","term_description"],l=["category","category_description","tag","tag_description"];e.hasClass("posttype-template")?o=o.concat(c,u):e.hasClass("homepage-template")?o=o.concat(r,i,s,c,u,l):e.hasClass("taxonomy-template")?o=o.concat(r,i,s,c):e.hasClass("author-template")?o=o.concat(s,i,c,u,l):e.hasClass("date-template")?o=o.concat(r,s,c,u,l):e.hasClass("search-template")?o=o.concat(r,i,s,u,l,["term404"]):e.hasClass("error404-template")&&(o=o.concat(r,i,s,u,l,["searchphrase"])),jQuery.each(o,function(o,r){if(a=e.attr("id")+"-"+r+"-warning",-1!==e.val().search("%%"+r+"%%")){e.addClass("wpseo-variable-warning-element");var i=wpseoAdminGlobalL10n.variable_warning.replace("%s","%%"+r+"%%");jQuery("#"+a).length?jQuery("#"+a).html(i):e.after(' <div id="'+a+'" class="wpseo-variable-warning">'+i+"</div>"),(0,n.default)(wpseoAdminGlobalL10n.variable_warning.replace("%s",r),"assertive"),t=!0}else jQuery("#"+a).length&&jQuery("#"+a).remove()}),!1===t&&e.removeClass("wpseo-variable-warning-element")}function t(){jQuery("#copy-home-meta-description").on("click",function(){jQuery("#og_frontpage_desc").val(jQuery("#meta_description").val())})}function a(){var e=jQuery("#wpseo-conf");if(e.length){var t=e.attr("action").split("#")[0];e.attr("action",t+window.location.hash)}}function r(e){var t=jQuery("#noindex-author-noposts-wpseo-container");e?t.show():t.hide()}jQuery.fn._wpseoIsInViewport=function(){var e=jQuery(this).offset().top,t=e+jQuery(this).outerHeight(),a=jQuery(window).scrollTop(),n=a+jQuery(window).height();return e>a&&t<n},jQuery(window).on("hashchange",a),window.wpseoDetectWrongVariables=e,window.setWPOption=function(e,t,a,n){jQuery.post(ajaxurl,{action:"wpseo_set_option",option:e,newval:t,_wpnonce:n},function(e){e&&jQuery("#"+a).hide()})},window.wpseoCopyHomeMeta=t,window.wpseoSetTabHash=a,jQuery(document).ready(function(){var n=this;a(),jQuery("#disable-author input[type='radio']").change(function(){jQuery(this).is(":checked")&&jQuery("#author-archives-titles-metas-content").toggle("off"===jQuery(this).val())}).change();var i=jQuery("#noindex-author-wpseo-off"),s=jQuery("#noindex-author-wpseo-on");i.is(":checked")||r(!1),s.change(function(){jQuery(n).is(":checked")||r(!1)}),i.change(function(){jQuery(n).is(":checked")||r(!0)}),jQuery("#disable-date input[type='radio']").change(function(){jQuery(this).is(":checked")&&jQuery("#date-archives-titles-metas-content").toggle("off"===jQuery(this).val())}).change(),jQuery("#disable-attachment input[type='radio']").change(function(){jQuery(this).is(":checked")&&jQuery("#media_settings").toggle("off"===jQuery(this).val())}).change(),jQuery("#disable-post_format").change(function(){jQuery("#post_format-titles-metas").toggle(jQuery(this).is(":not(:checked)"))}).change(),jQuery("#breadcrumbs-enable").change(function(){jQuery("#breadcrumbsinfo").toggle(jQuery(this).is(":checked"))}).change(),jQuery("#wpseo-tabs").find("a").click(function(){jQuery("#wpseo-tabs").find("a").removeClass("nav-tab-active"),jQuery(".wpseotab").removeClass("active");var e=jQuery(this).attr("id").replace("-tab",""),t=jQuery("#"+e);t.addClass("active"),jQuery(this).addClass("nav-tab-active"),t.hasClass("nosave")?jQuery("#wpseo-submit-container").hide():jQuery("#wpseo-submit-container").show(),jQuery(window).trigger("yoast-seo-tab-change")}),jQuery("#company_or_person").change(function(){var e=jQuery(this).val();"company"===e?(jQuery("#knowledge-graph-company").show(),jQuery("#knowledge-graph-person").hide()):"person"===e?(jQuery("#knowledge-graph-company").hide(),jQuery("#knowledge-graph-person").show()):(jQuery("#knowledge-graph-company").hide(),jQuery("#knowledge-graph-person").hide())}).change(),jQuery(".template").on("input",function(){e(jQuery(this))}),jQuery(".switch-yoast-seo input").on("keydown",function(e){"keydown"===e.type&&13===e.which&&e.preventDefault()}),jQuery("body").on("click","button.toggleable-container-trigger",function(e){var t=jQuery(e.currentTarget),a=t.parent().siblings(".toggleable-container");a.toggleClass("toggleable-container-hidden"),t.attr("aria-expanded",!a.hasClass("toggleable-container-hidden")).find("span").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2")});var c=jQuery("#opengraph"),u=jQuery("#wpseo-opengraph-settings");c.length&&u.length&&(u.toggle(c[0].checked),c.change(function(e){u.toggle(e.target.checked)})),t(),function(){var e=window.location.hash.replace("#top#","");-1!==e.search("#top")&&(e=window.location.hash.replace("#top%23","")),""!==e&&"#"!==e.charAt(0)||(e=jQuery(".wpseotab").attr("id")),jQuery("#"+e).addClass("active"),jQuery("#"+e+"-tab").addClass("nav-tab-active").click()}(),jQuery("#twitter_card_type").select2({width:"400px",language:wpseoSelect2Locale}),jQuery("#breadcrumbs select").select2({width:"400px",language:wpseoSelect2Locale}),function(){var e=jQuery("#wpseo-submit-container-float"),t=jQuery("#wpseo-submit-container-fixed");if(e.length&&t.length){jQuery(window).on("resize scroll",(0,o.debounce)(n,100)),jQuery(window).on("yoast-seo-tab-change",n);var a=jQuery(".wpseo-message");a.length&&window.setTimeout(function(){a.fadeOut()},5e3),n()}function n(){e._wpseoIsInViewport()?t.hide():t.show()}}()})}()}},[[440,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[14],{1:function(e,t){e.exports=window.lodash},458:function(e,t,a){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(a(46)),o=a(1);!function(){function e(e){var t=!1,a="",o=[],r=["userid","name","user_description"],i=["date"],s=["title","parent_title","excerpt","excerpt_only","caption","focuskw","pt_single","pt_plural","modified","id"],c=["term404","searchphrase"],u=["term_title","term_description"],l=["category","category_description","tag","tag_description"];e.hasClass("posttype-template")?o=o.concat(c,u):e.hasClass("homepage-template")?o=o.concat(r,i,s,c,u,l):e.hasClass("taxonomy-template")?o=o.concat(r,i,s,c):e.hasClass("author-template")?o=o.concat(s,i,c,u,l):e.hasClass("date-template")?o=o.concat(r,s,c,u,l):e.hasClass("search-template")?o=o.concat(r,i,s,u,l,["term404"]):e.hasClass("error404-template")&&(o=o.concat(r,i,s,u,l,["searchphrase"])),jQuery.each(o,function(o,r){if(a=e.attr("id")+"-"+r+"-warning",-1!==e.val().search("%%"+r+"%%")){e.addClass("wpseo-variable-warning-element");var i=wpseoAdminGlobalL10n.variable_warning.replace("%s","%%"+r+"%%");jQuery("#"+a).length?jQuery("#"+a).html(i):e.after(' <div id="'+a+'" class="wpseo-variable-warning">'+i+"</div>"),(0,n.default)(wpseoAdminGlobalL10n.variable_warning.replace("%s",r),"assertive"),t=!0}else jQuery("#"+a).length&&jQuery("#"+a).remove()}),!1===t&&e.removeClass("wpseo-variable-warning-element")}function t(){jQuery("#copy-home-meta-description").on("click",function(){jQuery("#og_frontpage_desc").val(jQuery("#meta_description").val())})}function a(){var e=jQuery("#wpseo-conf");if(e.length){var t=e.attr("action").split("#")[0];e.attr("action",t+window.location.hash)}}function r(e){var t=jQuery("#noindex-author-noposts-wpseo-container");e?t.show():t.hide()}jQuery.fn._wpseoIsInViewport=function(){var e=jQuery(this).offset().top,t=e+jQuery(this).outerHeight(),a=jQuery(window).scrollTop(),n=a+jQuery(window).height();return e>a&&t<n},jQuery(window).on("hashchange",a),window.wpseoDetectWrongVariables=e,window.setWPOption=function(e,t,a,n){jQuery.post(ajaxurl,{action:"wpseo_set_option",option:e,newval:t,_wpnonce:n},function(e){e&&jQuery("#"+a).hide()})},window.wpseoCopyHomeMeta=t,window.wpseoSetTabHash=a,jQuery(document).ready(function(){var n=this;a(),jQuery("#disable-author input[type='radio']").change(function(){jQuery(this).is(":checked")&&jQuery("#author-archives-titles-metas-content").toggle("off"===jQuery(this).val())}).change();var i=jQuery("#noindex-author-wpseo-off"),s=jQuery("#noindex-author-wpseo-on");i.is(":checked")||r(!1),s.change(function(){jQuery(n).is(":checked")||r(!1)}),i.change(function(){jQuery(n).is(":checked")||r(!0)}),jQuery("#disable-date input[type='radio']").change(function(){jQuery(this).is(":checked")&&jQuery("#date-archives-titles-metas-content").toggle("off"===jQuery(this).val())}).change(),jQuery("#disable-attachment input[type='radio']").change(function(){jQuery(this).is(":checked")&&jQuery("#media_settings").toggle("off"===jQuery(this).val())}).change(),jQuery("#disable-post_format").change(function(){jQuery("#post_format-titles-metas").toggle(jQuery(this).is(":not(:checked)"))}).change(),jQuery("#breadcrumbs-enable").change(function(){jQuery("#breadcrumbsinfo").toggle(jQuery(this).is(":checked"))}).change(),jQuery("#wpseo-tabs").find("a").click(function(){jQuery("#wpseo-tabs").find("a").removeClass("nav-tab-active"),jQuery(".wpseotab").removeClass("active");var e=jQuery(this).attr("id").replace("-tab",""),t=jQuery("#"+e);t.addClass("active"),jQuery(this).addClass("nav-tab-active"),t.hasClass("nosave")?jQuery("#wpseo-submit-container").hide():jQuery("#wpseo-submit-container").show(),jQuery(window).trigger("yoast-seo-tab-change")}),jQuery("#company_or_person").change(function(){var e=jQuery(this).val();"company"===e?(jQuery("#knowledge-graph-company").show(),jQuery("#knowledge-graph-person").hide()):"person"===e?(jQuery("#knowledge-graph-company").hide(),jQuery("#knowledge-graph-person").show()):(jQuery("#knowledge-graph-company").hide(),jQuery("#knowledge-graph-person").hide())}).change(),jQuery(".template").on("input",function(){e(jQuery(this))}),jQuery(".switch-yoast-seo input").on("keydown",function(e){"keydown"===e.type&&13===e.which&&e.preventDefault()}),jQuery("body").on("click","button.toggleable-container-trigger",function(e){var t=jQuery(e.currentTarget),a=t.parent().siblings(".toggleable-container");a.toggleClass("toggleable-container-hidden"),t.attr("aria-expanded",!a.hasClass("toggleable-container-hidden")).find("span").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2")});var c=jQuery("#opengraph"),u=jQuery("#wpseo-opengraph-settings");c.length&&u.length&&(u.toggle(c[0].checked),c.change(function(e){u.toggle(e.target.checked)})),t(),function(){var e=window.location.hash.replace("#top#","");-1!==e.search("#top")&&(e=window.location.hash.replace("#top%23","")),""!==e&&"#"!==e.charAt(0)||(e=jQuery(".wpseotab").attr("id")),jQuery("#"+e).addClass("active"),jQuery("#"+e+"-tab").addClass("nav-tab-active").click()}(),jQuery("#twitter_card_type").select2({width:"400px",language:wpseoSelect2Locale}),jQuery("#breadcrumbs select").select2({width:"400px",language:wpseoSelect2Locale}),function(){var e=jQuery("#wpseo-submit-container-float"),t=jQuery("#wpseo-submit-container-fixed");if(e.length&&t.length){jQuery(window).on("resize scroll",(0,o.debounce)(n,100)),jQuery(window).on("yoast-seo-tab-change",n);var a=jQuery(".wpseo-message");a.length&&window.setTimeout(function(){a.fadeOut()},5e3),n()}function n(){e._wpseoIsInViewport()?t.hide():t.show()}}()})}()},46:function(e,t){var a,n,o="",r=function(e){e=e||"polite";var t=document.createElement("div");t.id="a11y-speak-"+e,t.className="a11y-speak-region";return t.setAttribute("style","clip: rect(1px, 1px, 1px, 1px); position: absolute; height: 1px; width: 1px; overflow: hidden; word-wrap: normal;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true"),document.querySelector("body").appendChild(t),t};!function(e){if("complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll)return e();document.addEventListener("DOMContentLoaded",e)}(function(){a=document.getElementById("a11y-speak-polite"),n=document.getElementById("a11y-speak-assertive"),null===a&&(a=r("polite")),null===n&&(n=r("assertive"))});e.exports=function(e,t){!function(){for(var e=document.querySelectorAll(".a11y-speak-region"),t=0;t<e.length;t++)e[t].textContent=""}(),e=e.replace(/<[^<>]+>/g," "),o===e&&(e+=" "),o=e,n&&"assertive"===t?n.textContent=e:a&&(a.textContent=e)}}},[[458,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[11],{437:function(o,t,a){"use strict";!function(o){function t(o,t,a){jQuery.post(ajaxurl,{action:"wpseo_set_ignore",option:o,_wpnonce:a},function(a){a&&(jQuery("#"+t).hide(),jQuery("#hidden_ignore_"+o).val("ignore"))})}function a(){o("#wp-admin-bar-root-default > li").off("mouseenter.yoastalertpopup mouseleave.yoastalertpopup"),o(".yoast-issue-added").fadeOut(200)}function n(t,a){if(o(".yoast-notification-holder").off("click",".restore").off("click",".dismiss"),void 0!==a.html){a.html&&(t.closest(".yoast-container").html(a.html),s());var n=o("#wp-admin-bar-wpseo-menu"),e=n.find(".yoast-issue-counter");e.length||(n.find("> a:first-child").append('<div class="yoast-issue-counter"/>'),e=n.find(".yoast-issue-counter")),e.html(a.total),0===a.total?e.hide():e.show(),o("#toplevel_page_wpseo_dashboard .update-plugins").removeClass().addClass("update-plugins count-"+a.total),o("#toplevel_page_wpseo_dashboard .plugin-count").html(a.total)}}function s(){var t=o(".yoast-notification-holder");t.on("click",".dismiss",function(){var t=o(this),a=t.closest(".yoast-notification-holder");t.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),o.post(ajaxurl,{action:"yoast_dismiss_notification",notification:a.attr("id"),nonce:a.data("nonce"),data:a.data("json")},n.bind(this,a),"json")}),t.on("click",".restore",function(){var t=o(this),a=t.closest(".yoast-notification-holder");t.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),o.post(ajaxurl,{action:"yoast_restore_notification",notification:a.attr("id"),nonce:a.data("nonce"),data:a.data("json")},n.bind(this,a),"json")})}function e(o){o.is(":hidden")||(o.outerWidth()>o.parent().outerWidth()?(o.data("scrollHint").addClass("yoast-has-scroll"),o.data("scrollContainer").addClass("yoast-has-scroll")):(o.data("scrollHint").removeClass("yoast-has-scroll"),o.data("scrollContainer").removeClass("yoast-has-scroll")))}function i(){window.wpseoScrollableTables=o(".yoast-table-scrollable"),window.wpseoScrollableTables.length&&window.wpseoScrollableTables.each(function(){var t=o(this);if(!t.data("scrollContainer")){var a=o("<div />",{class:"yoast-table-scrollable__hintwrapper",html:"<span class='yoast-table-scrollable__hint' aria-hidden='true' />"}).insertBefore(t),n=o("<div />",{class:"yoast-table-scrollable__container",html:"<div class='yoast-table-scrollable__inner' />"}).insertBefore(t);a.find(".yoast-table-scrollable__hint").text(wpseoAdminGlobalL10n.scrollable_table_hint),t.data("scrollContainer",n),t.data("scrollHint",a),t.appendTo(n.find(".yoast-table-scrollable__inner")),e(t)}})}jQuery(document).ready(function(){if(void 0!==window.wpseoConsoleNotifications&&"undefined"!=typeof console)for(var o=0;o<wpseoConsoleNotifications.length;o++)console.warn(wpseoConsoleNotifications[o])}),jQuery(document).ready(function(){jQuery(".yoast-dismissible").on("click",".yoast-notice-dismiss",function(){var o=jQuery(this).parent();return jQuery.post(ajaxurl,{action:o.attr("id").replace(/-/g,"_"),_wpnonce:o.data("nonce"),data:o.data("json")}),jQuery.post(ajaxurl,{action:"yoast_dismiss_notification",notification:o.attr("id"),nonce:o.data("nonce"),data:o.data("json")}),o.fadeTo(100,0,function(){o.slideUp(100,function(){o.remove()})}),!1}),jQuery(".yoast-help-button").on("click",function(){var o=jQuery(this),t=jQuery("#"+o.attr("aria-controls")),a=t.is(":visible");jQuery(t).slideToggle(200,function(){o.attr("aria-expanded",!a)})}),jQuery("#robotsmessage button").on("click",function(){t("search_engines_discouraged_notice","robotsmessage",jQuery(this).data("nonce"))})}),window.wpseoSetIgnore=t,window.wpseoDismissLink=function(o){return jQuery('<a href="'+o+'" type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></a>')},o(window).on("wp-window-resized orientationchange",function(){window.wpseoScrollableTables&&window.wpseoScrollableTables.length&&function(t){t.each(function(){e(o(this))})}(window.wpseoScrollableTables)}),o(window).on({"Yoast:YoastTabsMounted":function(){setTimeout(function(){i()},100)},"Yoast:YoastTabsSelected":function(){setTimeout(function(){i()},100)}}),o(document).ready(function(){o(".yoast-issue-added").on("mouseenter mouseleave",function(o){o.stopPropagation(),a()}).fadeIn(),o("#wp-admin-bar-root-default > li").on("mouseenter.yoastalertpopup mouseleave.yoastalertpopup",a),setTimeout(a,3e3),s(),function(){var o=jQuery(".wpseo-js-premium-indicator"),t=o.find("svg");if(o.hasClass("wpseo-premium-indicator--no")){var a=t.find("path"),n=o.css("backgroundColor");a.css("fill",n)}t.css("display","block"),o.css({backgroundColor:"transparent",width:"20px",height:"20px"})}(),i()})}(jQuery)}},[[437,0]]]); (window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[11],{455:function(o,t,a){"use strict";!function(o){function t(o,t,a){jQuery.post(ajaxurl,{action:"wpseo_set_ignore",option:o,_wpnonce:a},function(a){a&&(jQuery("#"+t).hide(),jQuery("#hidden_ignore_"+o).val("ignore"))})}function a(){o("#wp-admin-bar-root-default > li").off("mouseenter.yoastalertpopup mouseleave.yoastalertpopup"),o(".yoast-issue-added").fadeOut(200)}function n(t,a){if(o(".yoast-notification-holder").off("click",".restore").off("click",".dismiss"),void 0!==a.html){a.html&&(t.closest(".yoast-container").html(a.html),s());var n=o("#wp-admin-bar-wpseo-menu"),e=n.find(".yoast-issue-counter");e.length||(n.find("> a:first-child").append('<div class="yoast-issue-counter"/>'),e=n.find(".yoast-issue-counter")),e.html(a.total),0===a.total?e.hide():e.show(),o("#toplevel_page_wpseo_dashboard .update-plugins").removeClass().addClass("update-plugins count-"+a.total),o("#toplevel_page_wpseo_dashboard .plugin-count").html(a.total)}}function s(){var t=o(".yoast-notification-holder");t.on("click",".dismiss",function(){var t=o(this),a=t.closest(".yoast-notification-holder");t.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),o.post(ajaxurl,{action:"yoast_dismiss_notification",notification:a.attr("id"),nonce:a.data("nonce"),data:a.data("json")},n.bind(this,a),"json")}),t.on("click",".restore",function(){var t=o(this),a=t.closest(".yoast-notification-holder");t.closest(".yoast-container").append('<div class="yoast-container-disabled"/>'),o.post(ajaxurl,{action:"yoast_restore_notification",notification:a.attr("id"),nonce:a.data("nonce"),data:a.data("json")},n.bind(this,a),"json")})}function e(o){o.is(":hidden")||(o.outerWidth()>o.parent().outerWidth()?(o.data("scrollHint").addClass("yoast-has-scroll"),o.data("scrollContainer").addClass("yoast-has-scroll")):(o.data("scrollHint").removeClass("yoast-has-scroll"),o.data("scrollContainer").removeClass("yoast-has-scroll")))}function i(){window.wpseoScrollableTables=o(".yoast-table-scrollable"),window.wpseoScrollableTables.length&&window.wpseoScrollableTables.each(function(){var t=o(this);if(!t.data("scrollContainer")){var a=o("<div />",{class:"yoast-table-scrollable__hintwrapper",html:"<span class='yoast-table-scrollable__hint' aria-hidden='true' />"}).insertBefore(t),n=o("<div />",{class:"yoast-table-scrollable__container",html:"<div class='yoast-table-scrollable__inner' />"}).insertBefore(t);a.find(".yoast-table-scrollable__hint").text(wpseoAdminGlobalL10n.scrollable_table_hint),t.data("scrollContainer",n),t.data("scrollHint",a),t.appendTo(n.find(".yoast-table-scrollable__inner")),e(t)}})}jQuery(document).ready(function(){if(void 0!==window.wpseoConsoleNotifications&&"undefined"!=typeof console)for(var o=0;o<wpseoConsoleNotifications.length;o++)console.warn(wpseoConsoleNotifications[o])}),jQuery(document).ready(function(){jQuery(".yoast-dismissible").on("click",".yoast-notice-dismiss",function(){var o=jQuery(this).parent();return jQuery.post(ajaxurl,{action:o.attr("id").replace(/-/g,"_"),_wpnonce:o.data("nonce"),data:o.data("json")}),jQuery.post(ajaxurl,{action:"yoast_dismiss_notification",notification:o.attr("id"),nonce:o.data("nonce"),data:o.data("json")}),o.fadeTo(100,0,function(){o.slideUp(100,function(){o.remove()})}),!1}),jQuery(".yoast-help-button").on("click",function(){var o=jQuery(this),t=jQuery("#"+o.attr("aria-controls")),a=t.is(":visible");jQuery(t).slideToggle(200,function(){o.attr("aria-expanded",!a)})}),jQuery("#robotsmessage button").on("click",function(){t("search_engines_discouraged_notice","robotsmessage",jQuery(this).data("nonce"))})}),window.wpseoSetIgnore=t,window.wpseoDismissLink=function(o){return jQuery('<a href="'+o+'" type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></a>')},o(window).on("wp-window-resized orientationchange",function(){window.wpseoScrollableTables&&window.wpseoScrollableTables.length&&function(t){t.each(function(){e(o(this))})}(window.wpseoScrollableTables)}),o(window).on({"Yoast:YoastTabsMounted":function(){setTimeout(function(){i()},100)},"Yoast:YoastTabsSelected":function(){setTimeout(function(){i()},100)}}),o(document).ready(function(){o(".yoast-issue-added").on("mouseenter mouseleave",function(o){o.stopPropagation(),a()}).fadeIn(),o("#wp-admin-bar-root-default > li").on("mouseenter.yoastalertpopup mouseleave.yoastalertpopup",a),setTimeout(a,3e3),s(),function(){var o=jQuery(".wpseo-js-premium-indicator"),t=o.find("svg");if(o.hasClass("wpseo-premium-indicator--no")){var a=t.find("path"),n=o.css("backgroundColor");a.css("fill",n)}t.css("display","block"),o.css({backgroundColor:"transparent",width:"20px",height:"20px"})}(),i()})}(jQuery)}},[[455,0]]]);
\ No newline at end of file \ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[12],{438:function(o,e,n){"use strict";function s(){console.error("This function is deprecated since WPSEO 12.5")}function i(){console.error("This function is deprecated since WPSEO 12.5")}function d(){console.error("This function is deprecated since WPSEO 12.5")}window.wpseoUpdateCategoryCount=s,window.wpseoMarkAsFixed=d,window.wpseoSendMarkAsFixed=i,window.wpseo_update_category_count=s,window.wpseo_mark_as_fixed=d,window.wpseo_send_mark_as_fixed=i}},[[438,0]]]); (window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[12],{456:function(o,e,n){"use strict";function s(){console.error("This function is deprecated since WPSEO 12.5")}function i(){console.error("This function is deprecated since WPSEO 12.5")}function d(){console.error("This function is deprecated since WPSEO 12.5")}window.wpseoUpdateCategoryCount=s,window.wpseoMarkAsFixed=d,window.wpseoSendMarkAsFixed=i,window.wpseo_update_category_count=s,window.wpseo_mark_as_fixed=d,window.wpseo_send_mark_as_fixed=i}},[[456,0]]]);
\ No newline at end of file \ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[13],{439:function(e,t,a){"use strict";jQuery(document).ready(function(e){void 0!==wp.media&&e(".wpseo_image_upload_button").each(function(t,a){var n=function(t){var a=(t=e(t)).data("target");return a&&""!==a||(a=e(t).attr("id").replace(/_button$/,"")),a}(a),i=function(t){return(t=e(t)).data("target-id")}(a),o=e("#"+n),r=e("#"+i),u=wp.media.frames.file_frame=wp.media({title:wpseoMediaL10n.choose_image,button:{text:wpseoMediaL10n.choose_image},multiple:!1,library:{type:"image"}});u.on("select",function(){var e=u.state().get("selection").first().toJSON();o.val(e.url),r.val(e.id)});var c=e(a);c.click(function(e){e.preventDefault(),u.open()}),c.siblings(".wpseo_image_remove_button").on("click",function(e){e.preventDefault(),o.val(""),r.val("")})})})}},[[439,0]]]); (window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[13],{457:function(e,t,a){"use strict";jQuery(document).ready(function(e){void 0!==wp.media&&e(".wpseo_image_upload_button").each(function(t,a){var n=function(t){var a=(t=e(t)).data("target");return a&&""!==a||(a=e(t).attr("id").replace(/_button$/,"")),a}(a),i=function(t){return(t=e(t)).data("target-id")}(a),o=e("#"+n),r=e("#"+i),u=wp.media.frames.file_frame=wp.media({title:wpseoMediaL10n.choose_image,button:{text:wpseoMediaL10n.choose_image},multiple:!1,library:{type:"image"}});u.on("select",function(){var e=u.state().get("selection").first().toJSON();o.val(e.url),r.val(e.id)});var c=e(a);c.click(function(e){e.preventDefault(),u.open()}),c.siblings(".wpseo_image_remove_button").on("click",function(e){e.preventDefault(),o.val(""),r.val("")})})})}},[[457,0]]]);
\ No newline at end of file \ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[22],{453:function(t,e,n){"use strict";!function(t,e){window.wpseoApi={get:function(t,e,n,o){this.request("GET",t,e,n,o)},post:function(t,e,n,o){this.request("POST",t,e,n,o)},put:function(t,e,n,o){this.request("PUT",t,e,n,o)},patch:function(t,e,n,o){this.request("PATCH",t,e,n,o)},delete:function(t,e,n,o){this.request("DELETE",t,e,n,o)},request:function(n,o,i,s,u){t.isFunction(i)&&void 0===u&&(u=s,s=i,i={}),"POST"!==n&&"GET"!==n&&(i._method=n,n="POST"),t.ajax({url:e.root+"yoast/v1/"+o,method:n,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",e.nonce)},data:i}).done(s).fail(u)}}}(jQuery,wpApiSettings)}},[[453,0]]]); (window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[22],{470:function(t,e,n){"use strict";!function(t,e){window.wpseoApi={get:function(t,e,n,o){this.request("GET",t,e,n,o)},post:function(t,e,n,o){this.request("POST",t,e,n,o)},put:function(t,e,n,o){this.request("PUT",t,e,n,o)},patch:function(t,e,n,o){this.request("PATCH",t,e,n,o)},delete:function(t,e,n,o){this.request("DELETE",t,e,n,o)},request:function(n,o,i,s,u){t.isFunction(i)&&void 0===u&&(u=s,s=i,i={}),"POST"!==n&&"GET"!==n&&(i._method=n,n="POST"),t.ajax({url:e.root+"yoast/v1/"+o,method:n,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",e.nonce)},data:i}).done(s).fail(u)}}}(jQuery,wpApiSettings)}},[[470,0]]]);
\ No newline at end of file \ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[15],{441:function(e,s,n){"use strict";!function(){var e=function(e){var s=e.find("[class^=wpseo-new]").first().attr("class"),n="#"+s+"-",t=n.replace("new","existing"),i=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),a=s.replace("-new-","_save_"),o="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],u=a.replace("wpseo_save_",""),r={newClass:"."+s,newId:n,existingId:t},l={submit_new:function(e){l.submitNew(e)},submitNew:function(e){var s,n=r.newId+e,t=r.existingId+e;s="select-one"===jQuery(r.newId+e).prop("type")?jQuery(n).find(":selected").text():jQuery(n).val();var o=jQuery(t).html();if(s===o)jQuery(n).val("");else{if(""===s&&!window.confirm("Are you sure you want to remove the existing "+i+"?"))return void jQuery(n).val("");var u={action:a,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:s,existing_value:o};jQuery.post(ajaxurl,u,l.handleResponse)}},submit_all:function(e){l.submitAll(e)},submitAll:function(e){e.preventDefault();var s={action:o,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};jQuery(r.newClass).each(function(){var e=jQuery(this).data("id"),n=jQuery(this).val(),t=jQuery(r.existingId+e).html();""!==n&&(n===t?jQuery(r.newId+e).val(""):(s.send=!0,s.items[e]=n,s.existingItems[e]=t))}),s.send&&jQuery.post(ajaxurl,s,l.handleResponses)},handle_response:function(e,s){l.handleResponse(e,s)},handleResponse:function(e,s){if("success"===s){var n=e;if("string"==typeof n&&(n=JSON.parse(n)),n instanceof Array)jQuery.each(n,function(){l.handleResponse(this,s)});else if("success"===n.status){var t=n["new_"+u];jQuery(r.existingId+n.post_id).html(t.replace(/\\(?!\\)/g,"")),jQuery(r.newId+n.post_id).val("")}}},handle_responses:function(e,s){l.handleResponses(e,s)},handleResponses:function(e,s){var n=jQuery.parseJSON(e);jQuery.each(n,function(){l.handleResponse(this,s)})},set_events:function(){l.setEvents()},setEvents:function(){e.find(".wpseo-save").click(function(e){var s=jQuery(this).data("id");e.preventDefault(),l.submitNew(s,this)}),e.find(".wpseo-save-all").click(l.submitAll),e.find(r.newClass).keydown(function(e){if(13===e.which){e.preventDefault();var s=jQuery(this).data("id");l.submitNew(s,this)}})}};return l};window.bulk_editor=e,window.bulkEditor=e,jQuery(document).ready(function(){jQuery('table[class*="wpseo_bulk"]').each(function(s,n){var t=jQuery(n);e(t).setEvents()})})}()}},[[441,0]]]); (window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[15],{459:function(e,s,n){"use strict";!function(){var e=function(e){var s=e.find("[class^=wpseo-new]").first().attr("class"),n="#"+s+"-",t=n.replace("new","existing"),i=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),a=s.replace("-new-","_save_"),o="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],u=a.replace("wpseo_save_",""),r={newClass:"."+s,newId:n,existingId:t},l={submit_new:function(e){l.submitNew(e)},submitNew:function(e){var s,n=r.newId+e,t=r.existingId+e;s="select-one"===jQuery(r.newId+e).prop("type")?jQuery(n).find(":selected").text():jQuery(n).val();var o=jQuery(t).html();if(s===o)jQuery(n).val("");else{if(""===s&&!window.confirm("Are you sure you want to remove the existing "+i+"?"))return void jQuery(n).val("");var u={action:a,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:s,existing_value:o};jQuery.post(ajaxurl,u,l.handleResponse)}},submit_all:function(e){l.submitAll(e)},submitAll:function(e){e.preventDefault();var s={action:o,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};jQuery(r.newClass).each(function(){var e=jQuery(this).data("id"),n=jQuery(this).val(),t=jQuery(r.existingId+e).html();""!==n&&(n===t?jQuery(r.newId+e).val(""):(s.send=!0,s.items[e]=n,s.existingItems[e]=t))}),s.send&&jQuery.post(ajaxurl,s,l.handleResponses)},handle_response:function(e,s){l.handleResponse(e,s)},handleResponse:function(e,s){if("success"===s){var n=e;if("string"==typeof n&&(n=JSON.parse(n)),n instanceof Array)jQuery.each(n,function(){l.handleResponse(this,s)});else if("success"===n.status){var t=n["new_"+u];jQuery(r.existingId+n.post_id).html(t.replace(/\\(?!\\)/g,"")),jQuery(r.newId+n.post_id).val("")}}},handle_responses:function(e,s){l.handleResponses(e,s)},handleResponses:function(e,s){var n=jQuery.parseJSON(e);jQuery.each(n,function(){l.handleResponse(this,s)})},set_events:function(){l.setEvents()},setEvents:function(){e.find(".wpseo-save").click(function(e){var s=jQuery(this).data("id");e.preventDefault(),l.submitNew(s,this)}),e.find(".wpseo-save-all").click(l.submitAll),e.find(r.newClass).keydown(function(e){if(13===e.which){e.preventDefault();var s=jQuery(this).data("id");l.submitNew(s,this)}})}};return l};window.bulk_editor=e,window.bulkEditor=e,jQuery(document).ready(function(){jQuery('table[class*="wpseo_bulk"]').each(function(s,n){var t=jQuery(n);e(t).setEvents()})})}()}},[[459,0]]]);
\ No newline at end of file \ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[4],{0:function(e,t){e.exports=React},1:function(e,t){e.exports=window.lodash},14:function(e,t){e.exports=ReactDOM},21:function(e,t){e.exports=window.yoast.styleGuide},3:function(e,t){e.exports=window.wp.i18n},35:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTextdomainL10n=r,t.setYoastComponentsL10n=function(){r("yoast-components")},t.setWordPressSeoL10n=function(){r("wordpress-seo")};var n=o(3),s=o(1);function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"wpseoYoastJSL10n",o=(0,s.get)(window,[t,e,"locale_data",e],!1);!1===o?(0,n.setLocaleData)({"":{}},e):(0,n.setLocaleData)(o,e)}},375:function(e,t,o){"use strict";var n=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),s=p(o(0)),r=p(o(14)),i=o(6),a=o(21),c=o(95),u=o(7),l=o(35);function p(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={statistics:null,feed:null},e.getStatistics(),e.getFeed(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.default.Component),n(t,[{key:"getStatistics",value:function(){var e=this;wpseoApi.get("statistics",function(o){var n={};n.seoScores=o.seo_scores.map(function(e){return{value:parseInt(e.count,10),color:t.getColorFromScore(e.seo_rank),html:'<a href="'+e.link+'">'+e.label+"</a>"}}),n.header=jQuery("<div>"+o.header+"</div>").text(),e.setState({statistics:n})})}},{key:"getFeed",value:function(){var e=this;(0,u.getPostFeed)("https://yoast.com/feed/widget/?wp_version="+wpseoDashboardWidgetL10n.wp_version+"&php_version="+wpseoDashboardWidgetL10n.php_version,2).then(function(t){t.items=t.items.map(function(e){return e.description=jQuery("<div>"+e.description+"</div>").text(),e.description=e.description.replace("The post "+e.title+" appeared first on Yoast.","").trim(),e}),e.setState({feed:t})}).catch(function(e){return console.log(e)})}},{key:"getSeoAssessment",value:function(){return null===this.state.statistics?null:wp.element.createElement(c.SiteSEOReport,{key:"yoast-seo-posts-assessment",seoAssessmentText:this.state.statistics.header,seoAssessmentItems:this.state.statistics.seoScores})}},{key:"getYoastFeed",value:function(){return null===this.state.feed?null:wp.element.createElement(i.ArticleList,{className:"wordpress-feed",key:"yoast-seo-blog-feed",title:wpseoDashboardWidgetL10n.feed_header,feed:this.state.feed,footerLinkText:wpseoDashboardWidgetL10n.feed_footer})}},{key:"render",value:function(){var e=[this.getSeoAssessment(),this.getYoastFeed()].filter(function(e){return null!==e});return 0===e.length?null:wp.element.createElement("div",null,e)}}],[{key:"getColorFromScore",value:function(e){return a.colors["$color_"+e]||a.colors.$color_grey}}]),t}(),d=document.getElementById("yoast-seo-dashboard-widget");d&&((0,l.setYoastComponentsL10n)(),r.default.render(wp.element.createElement(f,null),d))},6:function(e,t){e.exports=window.yoast.componentsNew},7:function(e,t){e.exports=window.yoast.helpers},95:function(e,t){e.exports=window.yoast.analysisReport}},[[375,0]]]); (window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[4],{0:function(e,t){e.exports=React},1:function(e,t){e.exports=window.lodash},15:function(e,t){e.exports=ReactDOM},22:function(e,t){e.exports=window.yoast.styleGuide},3:function(e,t){e.exports=window.wp.i18n},38:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTextdomainL10n=r,t.setYoastComponentsL10n=function(){r("yoast-components")},t.setWordPressSeoL10n=function(){r("wordpress-seo")};var n=o(3),s=o(1);function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"wpseoYoastJSL10n",o=(0,s.get)(window,[t,e,"locale_data",e],!1);!1===o?(0,n.setLocaleData)({"":{}},e):(0,n.setLocaleData)(o,e)}},393:function(e,t,o){"use strict";var n=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),s=p(o(0)),r=p(o(15)),i=o(6),a=o(22),c=o(98),u=o(7),l=o(38);function p(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={statistics:null,feed:null},e.getStatistics(),e.getFeed(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.default.Component),n(t,[{key:"getStatistics",value:function(){var e=this;wpseoApi.get("statistics",function(o){var n={};n.seoScores=o.seo_scores.map(function(e){return{value:parseInt(e.count,10),color:t.getColorFromScore(e.seo_rank),html:'<a href="'+e.link+'">'+e.label+"</a>"}}),n.header=jQuery("<div>"+o.header+"</div>").text(),e.setState({statistics:n})})}},{key:"getFeed",value:function(){var e=this;(0,u.getPostFeed)("https://yoast.com/feed/widget/?wp_version="+wpseoDashboardWidgetL10n.wp_version+"&php_version="+wpseoDashboardWidgetL10n.php_version,2).then(function(t){t.items=t.items.map(function(e){return e.description=jQuery("<div>"+e.description+"</div>").text(),e.description=e.description.replace("The post "+e.title+" appeared first on Yoast.","").trim(),e}),e.setState({feed:t})}).catch(function(e){return console.log(e)})}},{key:"getSeoAssessment",value:function(){return null===this.state.statistics?null:wp.element.createElement(c.SiteSEOReport,{key:"yoast-seo-posts-assessment",seoAssessmentText:this.state.statistics.header,seoAssessmentItems:this.state.statistics.seoScores})}},{key:"getYoastFeed",value:function(){return null===this.state.feed?null:wp.element.createElement(i.ArticleList,{className:"wordpress-feed",key:"yoast-seo-blog-feed",title:wpseoDashboardWidgetL10n.feed_header,feed:this.state.feed,footerLinkText:wpseoDashboardWidgetL10n.feed_footer})}},{key:"render",value:function(){var e=[this.getSeoAssessment(),this.getYoastFeed()].filter(function(e){return null!==e});return 0===e.length?null:wp.element.createElement("div",null,e)}}],[{key:"getColorFromScore",value:function(e){return a.colors["$color_"+e]||a.colors.$color_grey}}]),t}(),d=document.getElementById("yoast-seo-dashboard-widget");d&&((0,l.setYoastComponentsL10n)(),r.default.render(wp.element.createElement(f,null),d))},6:function(e,t){e.exports=window.yoast.componentsNew},7:function(e,t){e.exports=window.yoast.helpers},98:function(e,t){e.exports=window.yoast.analysisReport}},[[393,0]]]);
\ No newline at end of file \ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[16],{442:function(t,o,a){"use strict";!function(t){t(".yoast-column-header-has-tooltip").each(function(){t(this).closest("th").find("a").addClass("yoast-tooltip yoast-tooltip-alt yoast-tooltip-n yoast-tooltip-multiline").attr("data-label",t(this).data("tooltip-text")).attr("aria-label",t(this).text())})}(jQuery)}},[[442,0]]]); (window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[16],{460:function(t,o,a){"use strict";!function(t){t(".yoast-column-header-has-tooltip").each(function(){t(this).closest("th").find("a").addClass("yoast-tooltip yoast-tooltip-alt yoast-tooltip-n yoast-tooltip-multiline").attr("data-label",t(this).data("tooltip-text")).attr("aria-label",t(this).text())})}(jQuery)}},[[460,0]]]);
\ No newline at end of file \ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[17],{1:function(e,t){e.exports=window.lodash},233:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGutenbergDataAvailable=void 0;var a=i(1);t.isGutenbergDataAvailable=function(){return!(0,a.isNil)(window.wp)&&!(0,a.isNil)(wp.data)&&!(0,a.isNil)(wp.data.select("core/editor"))&&(0,a.isFunction)(wp.data.select("core/editor").getEditedPostAttribute)}},43:function(e,t){var i,a,n="",o=function(e){e=e||"polite";var t=document.createElement("div");t.id="a11y-speak-"+e,t.className="a11y-speak-region";return t.setAttribute("style","clip: rect(1px, 1px, 1px, 1px); position: absolute; height: 1px; width: 1px; overflow: hidden; word-wrap: normal;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true"),document.querySelector("body").appendChild(t),t};!function(e){if("complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll)return e();document.addEventListener("DOMContentLoaded",e)}(function(){i=document.getElementById("a11y-speak-polite"),a=document.getElementById("a11y-speak-assertive"),null===i&&(i=o("polite")),null===a&&(a=o("assertive"))});e.exports=function(e,t){!function(){for(var e=document.querySelectorAll(".a11y-speak-region"),t=0;t<e.length;t++)e[t].textContent=""}(),e=e.replace(/<[^<>]+>/g," "),n===e&&(e+=" "),n=e,a&&"assertive"===t?a.textContent=e:i&&(i.textContent=e)}},443:function(e,t,i){"use strict";var a=function(e){return e&&e.__esModule?e:{default:e}}(i(43)),n=i(233);!function(e){var t,i,o,r=function(e){this._app=e,this.featuredImage=null,this.pluginName="addFeaturedImagePlugin",this.registerPlugin(),this.registerModifications()};function s(){e("#yst_opengraph_image_warning").remove(),i.removeClass("yoast-opengraph-image-notice")}r.prototype.setFeaturedImage=function(e){this.featuredImage=e,this._app.pluginReloaded(this.pluginName)},r.prototype.removeFeaturedImage=function(){this.setFeaturedImage(null)},r.prototype.registerPlugin=function(){this._app.registerPlugin(this.pluginName,{status:"ready"})},r.prototype.registerModifications=function(){this._app.registerModification("content",this.addImageToContent.bind(this),this.pluginName,10)},r.prototype.addImageToContent=function(e){return null!==this.featuredImage&&(e+=this.featuredImage),e},e(document).ready(function(){var d=wp.media.featuredImage.frame();if("undefined"!=typeof YoastSEO&&(t=new r(YoastSEO.app),i=e("#postimagediv"),o=i.find(".hndle"),d.on("select",function(){var n,r,u;!function(t){var n=t.state().get("selection").first().toJSON();n.width<200||n.height<200?0===e("#yst_opengraph_image_warning").length&&(e('<div id="yst_opengraph_image_warning" class="notice notice-error notice-alt"><p>'+wpseoFeaturedImageL10n.featured_image_notice+"</p></div>").insertAfter(o),i.addClass("yoast-opengraph-image-notice"),(0,a.default)(wpseoFeaturedImageL10n.featured_image_notice,"assertive")):s()}(d),u=(r=d.state().get("selection").first()).get("alt"),n='<img src="'+r.get("url")+'" width="'+r.get("width")+'" height="'+r.get("height")+'" alt="'+u+'"/>',t.setFeaturedImage(n)}),i.on("click","#remove-post-thumbnail",function(){t.removeFeaturedImage(),s()}),void 0!==e("#set-post-thumbnail > img").prop("src")&&t.setFeaturedImage(e("#set-post-thumbnail ").html()),(0,n.isGutenbergDataAvailable)())){var u=void 0,p=void 0;wp.data.subscribe(function(){var e=wp.data.select("core/editor").getEditedPostAttribute("featured_media");if(function(e){return"number"==typeof e&&e>0}(e)&&void 0!==(u=wp.data.select("core").getMedia(e))&&u!==p){p=u;var i='<img src="'+u.source_url+'" alt="'+u.alt_text+'" >';t.setFeaturedImage(i)}})}})}(jQuery),window.yst_removeOpengraphWarning=function(){console.error("yst_removeOpengraphWarning is deprecated since Yoast SEO 10.1.")}}},[[443,0]]]); (window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[17],{1:function(e,t){e.exports=window.lodash},251:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGutenbergDataAvailable=void 0;var a=i(1);t.isGutenbergDataAvailable=function(){return!(0,a.isNil)(window.wp)&&!(0,a.isNil)(wp.data)&&!(0,a.isNil)(wp.data.select("core/editor"))&&(0,a.isFunction)(wp.data.select("core/editor").getEditedPostAttribute)}},46:function(e,t){var i,a,n="",o=function(e){e=e||"polite";var t=document.createElement("div");t.id="a11y-speak-"+e,t.className="a11y-speak-region";return t.setAttribute("style","clip: rect(1px, 1px, 1px, 1px); position: absolute; height: 1px; width: 1px; overflow: hidden; word-wrap: normal;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true"),document.querySelector("body").appendChild(t),t};!function(e){if("complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll)return e();document.addEventListener("DOMContentLoaded",e)}(function(){i=document.getElementById("a11y-speak-polite"),a=document.getElementById("a11y-speak-assertive"),null===i&&(i=o("polite")),null===a&&(a=o("assertive"))});e.exports=function(e,t){!function(){for(var e=document.querySelectorAll(".a11y-speak-region"),t=0;t<e.length;t++)e[t].textContent=""}(),e=e.replace(/<[^<>]+>/g," "),n===e&&(e+=" "),n=e,a&&"assertive"===t?a.textContent=e:i&&(i.textContent=e)}},461:function(e,t,i){"use strict";var a=function(e){return e&&e.__esModule?e:{default:e}}(i(46)),n=i(251);!function(e){var t,i,o,r=function(e){this._app=e,this.featuredImage=null,this.pluginName="addFeaturedImagePlugin",this.registerPlugin(),this.registerModifications()};function s(){e("#yst_opengraph_image_warning").remove(),i.removeClass("yoast-opengraph-image-notice")}r.prototype.setFeaturedImage=function(e){this.featuredImage=e,this._app.pluginReloaded(this.pluginName)},r.prototype.removeFeaturedImage=function(){this.setFeaturedImage(null)},r.prototype.registerPlugin=function(){this._app.registerPlugin(this.pluginName,{status:"ready"})},r.prototype.registerModifications=function(){this._app.registerModification("content",this.addImageToContent.bind(this),this.pluginName,10)},r.prototype.addImageToContent=function(e){return null!==this.featuredImage&&(e+=this.featuredImage),e},e(document).ready(function(){var d=wp.media.featuredImage.frame();if("undefined"!=typeof YoastSEO&&(t=new r(YoastSEO.app),i=e("#postimagediv"),o=i.find(".hndle"),d.on("select",function(){var n,r,u;!function(t){var n=t.state().get("selection").first().toJSON();n.width<200||n.height<200?0===e("#yst_opengraph_image_warning").length&&(e('<div id="yst_opengraph_image_warning" class="notice notice-error notice-alt"><p>'+wpseoFeaturedImageL10n.featured_image_notice+"</p></div>").insertAfter(o),i.addClass("yoast-opengraph-image-notice"),(0,a.default)(wpseoFeaturedImageL10n.featured_image_notice,"assertive")):s()}(d),u=(r=d.state().get("selection").first()).get("alt"),n='<img src="'+r.get("url")+'" width="'+r.get("width")+'" height="'+r.get("height")+'" alt="'+u+'"/>',t.setFeaturedImage(n)}),i.on("click","#remove-post-thumbnail",function(){t.removeFeaturedImage(),s()}),void 0!==e("#set-post-thumbnail > img").prop("src")&&t.setFeaturedImage(e("#set-post-thumbnail ").html()),(0,n.isGutenbergDataAvailable)())){var u=void 0,p=void 0;wp.data.subscribe(function(){var e=wp.data.select("core/editor").getEditedPostAttribute("featured_media");if(function(e){return"number"==typeof e&&e>0}(e)&&void 0!==(u=wp.data.select("core").getMedia(e))&&u!==p){p=u;var i='<img src="'+u.source_url+'" alt="'+u.alt_text+'" >';t.setFeaturedImage(i)}})}})}(jQuery),window.yst_removeOpengraphWarning=function(){console.error("yst_removeOpengraphWarning is deprecated since Yoast SEO 10.1.")}}},[[461,0]]]);
\ No newline at end of file \ No newline at end of file
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