Commit 9ec0f089 authored by Simon's avatar Simon

Merge branch 'release-1.20.1'

parents b1aff776 2913b079
......@@ -20,9 +20,9 @@
## Production
- build CSS & JS assets - `C:\web\dev.biuro\ npm run build`
- build new image `docker build -t biuro/web:1.20.0 .` (update version number)
- build new image `docker build -t biuro/web:1.20.1 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.20.0`
- push image to docker repository - `docker push biuro/web:1.20.1`
## Production
- update biuro/web image version in .env file (staging or www)
......
......@@ -297,6 +297,31 @@ class WPSEO_Admin_Asset_Manager {
],
'in_footer' => false,
],
[
'name' => 'post-edit-classic',
'src' => 'post-edit-' . $flat_version,
'deps' => [
'jquery',
'wp-api',
'wp-api-fetch',
'wp-components',
'wp-compose',
'wp-data',
'wp-element',
'wp-i18n',
'wp-is-shallow-equal',
'wp-sanitize',
'wp-url',
'wp-util',
self::PREFIX . 'redux',
self::PREFIX . 'analysis',
self::PREFIX . 'components',
self::PREFIX . 'commons',
self::PREFIX . 'select2',
self::PREFIX . 'select2-translations',
],
'in_footer' => false,
],
[
'name' => 'term-edit',
'src' => 'term-edit-' . $flat_version,
......@@ -586,6 +611,9 @@ class WPSEO_Admin_Asset_Manager {
[
'name' => 'search-appearance',
'src' => 'search-appearance-' . $flat_version,
'deps' => [
self::PREFIX . 'monorepo',
],
],
[
'name' => 'monorepo',
......
......@@ -5,6 +5,8 @@
* @package WPSEO\Admin
*/
use Yoast\WP\SEO\Config\Schema_Types;
/**
* Class WPSEO_Admin_Pages.
*
......@@ -85,6 +87,7 @@ class WPSEO_Admin_Pages {
],
];
$schema_types = new Schema_Types();
$script_data['searchAppearance'] = [
'isRtl' => is_rtl(),
'userEditUrl' => add_query_arg( 'user_id', '{user_id}', admin_url( 'user-edit.php' ) ),
......@@ -92,6 +95,10 @@ class WPSEO_Admin_Pages {
'showLocalSEOUpsell' => $this->should_show_local_seo_upsell(),
'localSEOUpsellURL' => WPSEO_Shortlinker::get( 'https://yoa.st/3mp' ),
'knowledgeGraphCompanyInfoMissing' => WPSEO_Language_Utils::get_knowledge_graph_company_info_missing_l10n(),
'schema' => [
'pageTypeOptions' => $schema_types->get_page_type_options(),
'articleTypeOptions' => $schema_types->get_article_type_options(),
],
];
/**
......
......@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
*
* @var string
*/
const CURRENT_RELEASE = '8.6.1';
const CURRENT_RELEASE = '8.7.1';
/**
* The minimally supported version of Gutenberg by the plugin.
*
* @var string
*/
const MINIMUM_SUPPORTED = '8.6.1';
const MINIMUM_SUPPORTED = '8.7.1';
/**
* Holds the current version.
......
......@@ -124,7 +124,6 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
$asset_manager = new WPSEO_Admin_Asset_Manager();
$asset_manager->enqueue_style( 'primary-category' );
$asset_manager->enqueue_script( 'primary-category' );
$mapped_taxonomies = $this->get_mapped_taxonomies_for_js( $taxonomies );
......@@ -132,6 +131,7 @@ class WPSEO_Primary_Term_Admin implements WPSEO_WordPress_Integration {
'taxonomies' => $mapped_taxonomies,
];
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'post-edit', 'wpseoPrimaryCategoryL10n', $data );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'post-edit-classic', 'wpseoPrimaryCategoryL10n', $data );
}
/**
......
......@@ -5,6 +5,9 @@
* @package WPSEO\Admin\Formatter
*/
use Yoast\WP\SEO\Config\Schema_Types;
use Yoast\WP\SEO\Helpers\Options_Helper;
/**
* This class forces needed methods for the metabox localization.
*/
......@@ -46,6 +49,8 @@ class WPSEO_Metabox_Formatter {
private function get_defaults() {
$analysis_seo = new WPSEO_Metabox_Analysis_SEO();
$analysis_readability = new WPSEO_Metabox_Analysis_Readability();
$schema_types = new Schema_Types();
$options = new Options_Helper();
return [
'author_name' => get_the_author_meta( 'display_name' ),
......@@ -78,6 +83,12 @@ class WPSEO_Metabox_Formatter {
'facebook' => WPSEO_Options::get( 'opengraph', false ),
'twitter' => WPSEO_Options::get( 'twitter', false ),
],
'schema' => [
'displayFooter' => WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ),
'pageTypeOptions' => $schema_types->get_page_type_options(),
'articleTypeOptions' => $schema_types->get_article_type_options(),
],
'twitterCardType' => $options->get( 'twitter_card_type' ),
/**
* Filter to determine if the markers should be enabled or not.
......
......@@ -40,6 +40,13 @@ class WPSEO_Metabox extends WPSEO_Meta {
*/
protected $editor;
/**
* Whether or not the advanced metadata is enabled.
*
* @var bool
*/
protected $is_advanced_metadata_enabled;
/**
* Class constructor.
*/
......@@ -59,7 +66,8 @@ class WPSEO_Metabox extends WPSEO_Meta {
$this->editor = new WPSEO_Metabox_Editor();
$this->editor->register_hooks();
$this->social_is_enabled = WPSEO_Options::get( 'opengraph', false ) || WPSEO_Options::get( 'twitter', false );
$this->social_is_enabled = WPSEO_Options::get( 'opengraph', false ) || WPSEO_Options::get( 'twitter', false );
$this->is_advanced_metadata_enabled = WPSEO_Capability_Utils::current_user_can( 'wpseo_edit_advanced_metadata' ) || WPSEO_Options::get( 'disableadvanced_meta' ) === false;
$this->analysis_seo = new WPSEO_Metabox_Analysis_SEO();
$this->analysis_readability = new WPSEO_Metabox_Analysis_Readability();
......@@ -295,9 +303,12 @@ class WPSEO_Metabox extends WPSEO_Meta {
/**
* Outputs the meta box.
*
* @param WP_Post $post The post.
*/
public function meta_box() {
$content_sections = $this->get_content_sections();
public function meta_box( $post ) {
$content_sections = $this->get_content_sections( $post->post_type );
echo '<div class="wpseo-metabox-content">';
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $this->get_product_title is considered safe.
......@@ -323,9 +334,11 @@ class WPSEO_Metabox extends WPSEO_Meta {
/**
* Returns the relevant metabox sections for the current view.
*
* @param string $post_type The post type.
*
* @return WPSEO_Metabox_Section[]
*/
private function get_content_sections() {
private function get_content_sections( $post_type ) {
$content_sections = [];
$content_sections[] = $this->get_seo_meta_section();
......@@ -334,6 +347,10 @@ class WPSEO_Metabox extends WPSEO_Meta {
$content_sections[] = $this->get_readability_meta_section();
}
if ( $this->is_advanced_metadata_enabled ) {
$content_sections[] = $this->get_schema_meta_section( $post_type );
}
// Whether social is enabled.
if ( $this->social_is_enabled ) {
$content_sections[] = $this->get_social_meta_section();
......@@ -383,7 +400,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
$html_after = '';
if ( WPSEO_Capability_Utils::current_user_can( 'wpseo_edit_advanced_metadata' ) || WPSEO_Options::get( 'disableadvanced_meta' ) === false ) {
if ( $this->is_advanced_metadata_enabled ) {
$html_after = $this->get_tab_content( 'advanced' );
}
......@@ -404,6 +421,22 @@ class WPSEO_Metabox extends WPSEO_Meta {
);
}
/**
* Returns the metabox section for the schema tab.
*
* @param string $post_type The post type.
*
* @return WPSEO_Metabox_Section_React
*/
private function get_schema_meta_section( $post_type ) {
$content = $this->get_tab_content( 'schema', $post_type );
return new WPSEO_Metabox_Section_React(
'schema',
'<span class="wpseo-schema-icon"></span>' . __( 'Schema', 'wordpress-seo' ),
$content
);
}
/**
* Returns the metabox section for the readability analysis.
*
......@@ -466,13 +499,14 @@ class WPSEO_Metabox extends WPSEO_Meta {
/**
* Retrieves the contents for the metabox tab.
*
* @param string $tab_name Tab for which to retrieve the field definitions.
* @param string $tab_name Tab for which to retrieve the field definitions.
* @param string $post_type The post type. Defaults to post.
*
* @return string
*/
private function get_tab_content( $tab_name ) {
private function get_tab_content( $tab_name, $post_type = 'post' ) {
$content = '';
foreach ( WPSEO_Meta::get_meta_field_defs( $tab_name ) as $key => $meta_field ) {
foreach ( WPSEO_Meta::get_meta_field_defs( $tab_name, $post_type ) as $key => $meta_field ) {
$content .= $this->do_meta_box( $meta_field, $key );
}
......@@ -511,6 +545,11 @@ class WPSEO_Metabox extends WPSEO_Meta {
$description = '<p id="' . $esc_form_key . '-desc" class="yoast-metabox__description">' . $meta_field_def['description'] . '</p>';
}
// Add a hide_on_pages option that returns nothing when the field is rendered on a page.
if ( isset( $meta_field_def['hide_on_pages'] ) && $meta_field_def['hide_on_pages'] && get_post_type() === 'page' ) {
return '';
}
switch ( $meta_field_def['type'] ) {
case 'text':
$ac = '';
......@@ -539,7 +578,11 @@ class WPSEO_Metabox extends WPSEO_Meta {
break;
case 'hidden':
$content .= '<input type="hidden" id="' . $esc_form_key . '" name="' . $esc_form_key . '" value="' . esc_attr( $meta_value ) . '"/>' . "\n";
$default = '';
if ( isset( $meta_field_def['default'] ) ) {
$default = sprintf( ' data-default="%s"', esc_attr( $meta_field_def['default'] ) );
}
$content .= '<input type="hidden" id="' . $esc_form_key . '" name="' . $esc_form_key . '" value="' . esc_attr( $meta_value ) . '"' . $default . '/>' . "\n";
break;
case 'select':
if ( isset( $meta_field_def['options'] ) && is_array( $meta_field_def['options'] ) && $meta_field_def['options'] !== [] ) {
......@@ -725,7 +768,8 @@ class WPSEO_Metabox extends WPSEO_Meta {
$meta_boxes,
WPSEO_Meta::get_meta_field_defs( 'general', $post->post_type ),
WPSEO_Meta::get_meta_field_defs( 'advanced' ),
$social_fields
$social_fields,
WPSEO_Meta::get_meta_field_defs( 'schema', $post->post_type )
);
foreach ( $meta_boxes as $key => $meta_box ) {
......@@ -828,11 +872,15 @@ class WPSEO_Metabox extends WPSEO_Meta {
$asset_manager->enqueue_style( 'select2' );
$asset_manager->enqueue_style( 'monorepo' );
$asset_manager->enqueue_script( 'post-edit' );
$post_edit_handle = 'post-edit';
if ( ! WP_Screen::get()->is_block_editor() ) {
$post_edit_handle = 'post-edit-classic';
}
$asset_manager->enqueue_script( $post_edit_handle );
$asset_manager->enqueue_style( 'admin-css' );
$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n();
$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'post-edit' );
$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle );
/**
* Removes the emoji script as it is incompatible with both React and any
......@@ -840,8 +888,8 @@ class WPSEO_Metabox extends WPSEO_Meta {
*/
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'post-edit', 'wpseoAdminL10n', WPSEO_Utils::get_admin_l10n() );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'post-edit', 'wpseoFeaturesL10n', WPSEO_Utils::retrieve_enabled_features() );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle, 'wpseoAdminL10n', WPSEO_Utils::get_admin_l10n() );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle, 'wpseoFeaturesL10n', WPSEO_Utils::retrieve_enabled_features() );
$analysis_worker_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ) );
$used_keywords_assessment_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ), 'used-keywords-assessment' );
......@@ -887,7 +935,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
];
}
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'post-edit', 'wpseoScriptData', $script_data );
wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle, 'wpseoScriptData', $script_data );
}
/**
......
......@@ -133,27 +133,27 @@ class Yoast_Feature_Toggles {
'order' => 80,
],
(object) [
'name' => __( 'Security: no advanced settings for authors', 'wordpress-seo' ),
'name' => __( 'Security: no advanced or schema settings for authors', 'wordpress-seo' ),
'setting' => 'disableadvanced_meta',
'label' => sprintf(
/* translators: 1: Yoast SEO, 2: translated version of "Off" */
__( 'The advanced section of the %1$s meta box allows a user to remove posts from the search results or change the canonical. These are things you might not want any author to do. That\'s why, by default, only editors and administrators can do this. Setting to "%2$s" allows all users to change these settings.', 'wordpress-seo' ),
__( 'The advanced section of the %1$s meta box allows a user to remove posts from the search results or change the canonical. The settings in the schema tab allows a user to change schema meta data for a post. These are things you might not want any author to do. That\'s why, by default, only editors and administrators can do this. Setting to "%2$s" allows all users to change these settings.', 'wordpress-seo' ),
'Yoast SEO',
__( 'Off', 'wordpress-seo' )
),
'order' => 90,
],
(object) [
'name' => __( 'Usage tracking', 'wordpress-seo' ),
'label' => __( 'Usage tracking', 'wordpress-seo' ),
'setting' => 'tracking',
'name' => __( 'Usage tracking', 'wordpress-seo' ),
'label' => __( 'Usage tracking', 'wordpress-seo' ),
'setting' => 'tracking',
'read_more_label' => sprintf(
/* translators: 1: Yoast SEO */
__( 'Allow us to track some data about your site to improve our plugin.', 'wordpress-seo' ),
'Yoast SEO'
),
'read_more_url' => 'https://yoa.st/usage-tracking',
'order' => 95,
'order' => 95,
],
(object) [
'name' => __( 'REST API: Head endpoint', 'wordpress-seo' ),
......
......@@ -56,7 +56,8 @@ $knowledge_graph_help = new WPSEO_Admin_Help_Panel(
if ( empty( $yoast_seo_company_name ) || empty( $yoast_seo_company_logo ) ) :
?>
<div id="knowledge-graph-company-warning"></div>
<?php endif;
<?php
endif;
$yform->textinput( 'company_name', __( 'Organization name', 'wordpress-seo' ), [ 'autocomplete' => 'organization' ] );
$yform->media_input( 'company_logo', __( 'Organization logo', 'wordpress-seo' ) );
......
......@@ -11,6 +11,8 @@
* @uses WPSEO_Admin_Editor_Specific_Replace_Vars $editor_specific_replace_vars
*/
use Yoast\WP\SEO\Helpers\Schema\Article_Helper;
$show_post_type_help = $view_utils->search_results_setting_help( $wpseo_post_type );
$noindex_option_name = 'noindex-' . $wpseo_post_type->name;
......@@ -24,7 +26,7 @@ $yform->index_switch(
$yform->show_hide_switch(
'display-metabox-pt-' . $wpseo_post_type->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>' . $wpseo_post_type->labels->name . '</strong>' )
sprintf( esc_html__( 'Show SEO settings for %1$s', 'wordpress-seo' ), '<strong>' . $wpseo_post_type->labels->name . '</strong>' )
);
$editor = new WPSEO_Replacevar_Editor(
......@@ -38,3 +40,21 @@ $editor = new WPSEO_Replacevar_Editor(
]
);
$editor->render();
// Schema settings.
$article_helper = new Article_Helper();
$schema_page_type_option = 'schema-page-type-' . $wpseo_post_type->name;
$schema_article_type_option = 'schema-article-type-' . $wpseo_post_type->name;
$yform->hidden( $schema_page_type_option );
if ( $wpseo_post_type->name !== 'page' && $article_helper->is_author_supported( $wpseo_post_type->name ) ) {
$yform->hidden( $schema_article_type_option );
}
printf(
'<div class="yoast-schema-settings-container" data-schema-settings data-schema-settings-post-type="%1$s" data-schema-settings-post-type-name="%2$s" data-schema-settings-page-type-field-id="%3$s" data-schema-settings-article-type-field-id="%4$s" data-schema-settings-page-type-default="%5$s" data-schema-settings-article-type-default="%6$s"></div>',
$wpseo_post_type->name,
$wpseo_post_type->labels->name,
'hidden_' . $schema_page_type_option,
'hidden_' . $schema_article_type_option,
WPSEO_Options::get_default( 'wpseo_titles', $schema_page_type_option ),
WPSEO_Options::get_default( 'wpseo_titles', $schema_article_type_option )
);
This diff is collapsed.
.draftJsMentionPlugin__mentionSuggestions__2DWjA{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-transform:scale(0)}.draftJsMentionPlugin__mention__29BEd,.draftJsMentionPlugin__mention__29BEd:visited{color:#575f67;cursor:pointer;display:inline-block;background:#e6f3ff;padding-right:2px;padding-left:2px;border-radius:2px;text-decoration:none}.draftJsMentionPlugin__mention__29BEd:focus,.draftJsMentionPlugin__mention__29BEd:hover{color:#677584;background:#edf5fd;outline:0}.draftJsMentionPlugin__mention__29BEd:active{color:#222;background:#455261}.draftJsMentionPlugin__mentionSuggestionsEntry__3mSwm{padding:7px 10px 3px;transition:background-color .4s cubic-bezier(.27,1.27,.48,.56)}.draftJsMentionPlugin__mentionSuggestionsEntry__3mSwm:active{background-color:#cce7ff}.draftJsMentionPlugin__mentionSuggestionsEntryFocused__3LcTd{background-color:#e6f3ff}.draftJsMentionPlugin__mentionSuggestionsEntryText__3Jobq{display:inline-block;margin-right:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:368px;font-size:.9em;margin-bottom:.2em}.draftJsMentionPlugin__mentionSuggestionsEntryAvatar__1xgA9{display:inline-block;width:24px;height:24px;border-radius:12px}.draftJsMentionPlugin__mentionSuggestions__2DWjA{border:1px solid #eee;margin-top:.4em;position:absolute;min-width:220px;max-width:440px;background:#fff;border-radius:2px;box-shadow:0 4px 30px 0 #dcdcdc;cursor:pointer;padding-top:8px;padding-bottom:8px;z-index:2;display:flex;flex-direction:column;box-sizing:border-box;transform:scale(0)}.DraftEditor-editorContainer,.DraftEditor-root,.public-DraftEditor-content{height:inherit;text-align:initial}.public-DraftEditor-content[contenteditable=true]{-webkit-user-modify:read-write-plaintext-only}.DraftEditor-root{position:relative}.DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-right:.1px solid transparent;position:relative;z-index:1}.public-DraftEditor-block{position:relative}.DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:right}.DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{right:0;text-align:right}.DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:left}.DraftEditor-alignRight .public-DraftEditorPlaceholder-root{left:0;text-align:left}.public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:1}.public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.DraftEditorPlaceholder-hidden{display:none}.public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.public-DraftStyleDefault-ltr{direction:rtl;text-align:right}.public-DraftStyleDefault-rtl{direction:ltr;text-align:left}.public-DraftStyleDefault-listLTR{direction:rtl}.public-DraftStyleDefault-listRTL{direction:ltr}.public-DraftStyleDefault-ol,.public-DraftStyleDefault-ul{margin:16px 0;padding:0}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-right:1.5em}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-left:1.5em}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-right:3em}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-left:3em}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-right:4.5em}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-left:4.5em}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-right:6em}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-left:6em}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-right:7.5em}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-left:7.5em}.public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{right:-36px;position:absolute;text-align:left;width:30px}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;left:-36px;text-align:right;width:30px}.public-DraftStyleDefault-orderedListItem:before{content:counter(ol0) ". ";counter-increment:ol0}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(ol1) ". ";counter-increment:ol1}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(ol2) ". ";counter-increment:ol2}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(ol3) ". ";counter-increment:ol3}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(ol4) ". ";counter-increment:ol4}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:ol0}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:ol1}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:ol2}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:ol3}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:ol4}#person-selector{width:100%}
\ No newline at end of file
.draftJsMentionPlugin__mentionSuggestions__2DWjA{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-transform:scale(0)}.draftJsMentionPlugin__mention__29BEd,.draftJsMentionPlugin__mention__29BEd:visited{color:#575f67;cursor:pointer;display:inline-block;background:#e6f3ff;padding-left:2px;padding-right:2px;border-radius:2px;text-decoration:none}.draftJsMentionPlugin__mention__29BEd:focus,.draftJsMentionPlugin__mention__29BEd:hover{color:#677584;background:#edf5fd;outline:0}.draftJsMentionPlugin__mention__29BEd:active{color:#222;background:#455261}.draftJsMentionPlugin__mentionSuggestionsEntry__3mSwm{padding:7px 10px 3px;transition:background-color .4s cubic-bezier(.27,1.27,.48,.56)}.draftJsMentionPlugin__mentionSuggestionsEntry__3mSwm:active{background-color:#cce7ff}.draftJsMentionPlugin__mentionSuggestionsEntryFocused__3LcTd{background-color:#e6f3ff}.draftJsMentionPlugin__mentionSuggestionsEntryText__3Jobq{display:inline-block;margin-left:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:368px;font-size:.9em;margin-bottom:.2em}.draftJsMentionPlugin__mentionSuggestionsEntryAvatar__1xgA9{display:inline-block;width:24px;height:24px;border-radius:12px}.draftJsMentionPlugin__mentionSuggestions__2DWjA{border:1px solid #eee;margin-top:.4em;position:absolute;min-width:220px;max-width:440px;background:#fff;border-radius:2px;box-shadow:0 4px 30px 0 #dcdcdc;cursor:pointer;padding-top:8px;padding-bottom:8px;z-index:2;display:flex;flex-direction:column;box-sizing:border-box;transform:scale(0)}.DraftEditor-editorContainer,.DraftEditor-root,.public-DraftEditor-content{height:inherit;text-align:initial}.public-DraftEditor-content[contenteditable=true]{-webkit-user-modify:read-write-plaintext-only}.DraftEditor-root{position:relative}.DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.public-DraftEditor-block{position:relative}.DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:1}.public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.DraftEditorPlaceholder-hidden{display:none}.public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.public-DraftStyleDefault-listLTR{direction:ltr}.public-DraftStyleDefault-listRTL{direction:rtl}.public-DraftStyleDefault-ol,.public-DraftStyleDefault-ul{margin:16px 0;padding:0}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.public-DraftStyleDefault-orderedListItem:before{content:counter(ol0) ". ";counter-increment:ol0}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(ol1) ". ";counter-increment:ol1}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(ol2) ". ";counter-increment:ol2}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(ol3) ". ";counter-increment:ol3}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(ol4) ". ";counter-increment:ol4}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:ol0}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:ol1}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:ol2}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:ol3}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:ol4}#person-selector{width:100%}
\ No newline at end of file
.draftJsMentionPlugin__mentionSuggestions__2DWjA{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-transform:scale(0)}.yoast-schema-settings-container{margin-top:18px}.yoast-schema-settings-container:first-child{margin-top:0}.draftJsMentionPlugin__mention__29BEd,.draftJsMentionPlugin__mention__29BEd:visited{color:#575f67;cursor:pointer;display:inline-block;background:#e6f3ff;padding-right:2px;padding-left:2px;border-radius:2px;text-decoration:none}.draftJsMentionPlugin__mention__29BEd:focus,.draftJsMentionPlugin__mention__29BEd:hover{color:#677584;background:#edf5fd;outline:0}.draftJsMentionPlugin__mention__29BEd:active{color:#222;background:#455261}.draftJsMentionPlugin__mentionSuggestionsEntry__3mSwm{padding:7px 10px 3px;transition:background-color .4s cubic-bezier(.27,1.27,.48,.56)}.draftJsMentionPlugin__mentionSuggestionsEntry__3mSwm:active{background-color:#cce7ff}.draftJsMentionPlugin__mentionSuggestionsEntryFocused__3LcTd{background-color:#e6f3ff}.draftJsMentionPlugin__mentionSuggestionsEntryText__3Jobq{display:inline-block;margin-right:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:368px;font-size:.9em;margin-bottom:.2em}.draftJsMentionPlugin__mentionSuggestionsEntryAvatar__1xgA9{display:inline-block;width:24px;height:24px;border-radius:12px}.draftJsMentionPlugin__mentionSuggestions__2DWjA{border:1px solid #eee;margin-top:.4em;position:absolute;min-width:220px;max-width:440px;background:#fff;border-radius:2px;box-shadow:0 4px 30px 0 #dcdcdc;cursor:pointer;padding-top:8px;padding-bottom:8px;z-index:2;display:flex;flex-direction:column;box-sizing:border-box;transform:scale(0)}.DraftEditor-editorContainer,.DraftEditor-root,.public-DraftEditor-content{height:inherit;text-align:initial}.public-DraftEditor-content[contenteditable=true]{-webkit-user-modify:read-write-plaintext-only}.DraftEditor-root{position:relative}.DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-right:.1px solid transparent;position:relative;z-index:1}.public-DraftEditor-block{position:relative}.DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:right}.DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{right:0;text-align:right}.DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:left}.DraftEditor-alignRight .public-DraftEditorPlaceholder-root{left:0;text-align:left}.public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:1}.public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.DraftEditorPlaceholder-hidden{display:none}.public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.public-DraftStyleDefault-ltr{direction:rtl;text-align:right}.public-DraftStyleDefault-rtl{direction:ltr;text-align:left}.public-DraftStyleDefault-listLTR{direction:rtl}.public-DraftStyleDefault-listRTL{direction:ltr}.public-DraftStyleDefault-ol,.public-DraftStyleDefault-ul{margin:16px 0;padding:0}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-right:1.5em}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-left:1.5em}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-right:3em}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-left:3em}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-right:4.5em}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-left:4.5em}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-right:6em}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-left:6em}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-right:7.5em}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-left:7.5em}.public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{right:-36px;position:absolute;text-align:left;width:30px}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;left:-36px;text-align:right;width:30px}.public-DraftStyleDefault-orderedListItem:before{content:counter(ol0) ". ";counter-increment:ol0}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(ol1) ". ";counter-increment:ol1}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(ol2) ". ";counter-increment:ol2}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(ol3) ". ";counter-increment:ol3}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(ol4) ". ";counter-increment:ol4}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:ol0}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:ol1}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:ol2}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:ol3}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:ol4}#person-selector{width:100%}
\ No newline at end of file
.draftJsMentionPlugin__mentionSuggestions__2DWjA{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-transform:scale(0)}.yoast-schema-settings-container{margin-top:18px}.yoast-schema-settings-container:first-child{margin-top:0}.draftJsMentionPlugin__mention__29BEd,.draftJsMentionPlugin__mention__29BEd:visited{color:#575f67;cursor:pointer;display:inline-block;background:#e6f3ff;padding-left:2px;padding-right:2px;border-radius:2px;text-decoration:none}.draftJsMentionPlugin__mention__29BEd:focus,.draftJsMentionPlugin__mention__29BEd:hover{color:#677584;background:#edf5fd;outline:0}.draftJsMentionPlugin__mention__29BEd:active{color:#222;background:#455261}.draftJsMentionPlugin__mentionSuggestionsEntry__3mSwm{padding:7px 10px 3px;transition:background-color .4s cubic-bezier(.27,1.27,.48,.56)}.draftJsMentionPlugin__mentionSuggestionsEntry__3mSwm:active{background-color:#cce7ff}.draftJsMentionPlugin__mentionSuggestionsEntryFocused__3LcTd{background-color:#e6f3ff}.draftJsMentionPlugin__mentionSuggestionsEntryText__3Jobq{display:inline-block;margin-left:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:368px;font-size:.9em;margin-bottom:.2em}.draftJsMentionPlugin__mentionSuggestionsEntryAvatar__1xgA9{display:inline-block;width:24px;height:24px;border-radius:12px}.draftJsMentionPlugin__mentionSuggestions__2DWjA{border:1px solid #eee;margin-top:.4em;position:absolute;min-width:220px;max-width:440px;background:#fff;border-radius:2px;box-shadow:0 4px 30px 0 #dcdcdc;cursor:pointer;padding-top:8px;padding-bottom:8px;z-index:2;display:flex;flex-direction:column;box-sizing:border-box;transform:scale(0)}.DraftEditor-editorContainer,.DraftEditor-root,.public-DraftEditor-content{height:inherit;text-align:initial}.public-DraftEditor-content[contenteditable=true]{-webkit-user-modify:read-write-plaintext-only}.DraftEditor-root{position:relative}.DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.public-DraftEditor-block{position:relative}.DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:1}.public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.DraftEditorPlaceholder-hidden{display:none}.public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.public-DraftStyleDefault-listLTR{direction:ltr}.public-DraftStyleDefault-listRTL{direction:rtl}.public-DraftStyleDefault-ol,.public-DraftStyleDefault-ul{margin:16px 0;padding:0}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.public-DraftStyleDefault-orderedListItem:before{content:counter(ol0) ". ";counter-increment:ol0}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(ol1) ". ";counter-increment:ol1}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(ol2) ". ";counter-increment:ol2}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(ol3) ". ";counter-increment:ol3}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(ol4) ". ";counter-increment:ol4}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:ol0}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:ol1}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:ol2}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:ol3}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:ol4}#person-selector{width:100%}
\ No newline at end of file
......@@ -727,4 +727,18 @@ div.interface-pinned-items button.components-button.is-pressed[aria-label="Yoast
div.interface-pinned-items button.components-button.is-pressed[aria-label="Yoast SEO Premium"] > svg path {
fill: #ffffff;
}
.wpseo-schema-icon {
height: 16px;
width: 16px;
margin-right: 8px;
display: flex;
justify-content: center;
align-items: center;
background-image: var(--yoast-svg-icon-schema);
background-size: cover;
}
.wpseo-metabox-menu ul li.active a .wpseo-schema-icon {
background-image: var(--yoast-svg-icon-schema-active);
}
/*# sourceMappingURL=metabox.css.map */
......@@ -3,6 +3,13 @@
@import "../../node_modules/draft-js/dist/Draft.css";
/*rtl:end:ignore*/
.yoast-schema-settings-container {
margin-top: 18px;
}
.yoast-schema-settings-container:first-child {
margin-top: 0px;
}
.draftJsMentionPlugin__mention__29BEd, .draftJsMentionPlugin__mention__29BEd:visited {
color: #575f67;
cursor: pointer;
......
......@@ -6,6 +6,8 @@
* @since 1.5.0
*/
use Yoast\WP\SEO\Config\Schema_Types;
use Yoast\WP\SEO\Helpers\Schema\Article_Helper;
use Yoast\WP\SEO\Repositories\Indexable_Repository;
/**
......@@ -103,18 +105,18 @@ class WPSEO_Meta {
*/
public static $meta_fields = [
'general' => [
'focuskw' => [
'focuskw' => [
'type' => 'hidden',
'title' => '',
],
'title' => [
'title' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '',
'description' => '', // Translation added later.
'help' => '', // Translation added later.
],
'metadesc' => [
'metadesc' => [
'type' => 'hidden',
'title' => '', // Translation added later.
'default_value' => '',
......@@ -123,13 +125,13 @@ class WPSEO_Meta {
'description' => '', // Translation added later.
'help' => '', // Translation added later.
],
'linkdex' => [
'linkdex' => [
'type' => 'hidden',
'title' => 'linkdex',
'default_value' => '0',
'description' => '',
],
'content_score' => [
'content_score' => [
'type' => 'hidden',
'title' => 'content_score',
'default_value' => '0',
......@@ -193,6 +195,19 @@ class WPSEO_Meta {
],
],
'social' => [],
'schema' => [
'schema_page_type' => [
'type' => 'hidden',
'title' => '',
'options' => Schema_Types::PAGE_TYPES,
],
'schema_article_type' => [
'type' => 'hidden',
'title' => '',
'hide_on_pages' => true,
'options' => Schema_Types::ARTICLE_TYPES,
],
],
/* Fields we should validate & save, but not show on any form. */
'non_form' => [
'linkdex' => [
......@@ -249,7 +264,6 @@ class WPSEO_Meta {
* @return void
*/
public static function init() {
foreach ( self::$social_networks as $option => $network ) {
if ( WPSEO_Options::get( $option, false ) === true ) {
foreach ( self::$social_fields as $box => $type ) {
......@@ -363,6 +377,23 @@ class WPSEO_Meta {
unset( $field_defs['redirect'] );
}
break;
case 'schema':
if ( ! WPSEO_Capability_Utils::current_user_can( 'wpseo_edit_advanced_metadata' ) && WPSEO_Options::get( 'disableadvanced_meta' ) ) {
return [];
}
$field_defs['schema_page_type']['default'] = WPSEO_Options::get( 'schema-page-type-' . $post_type );
$article_helper = new Article_Helper();
if ( $post_type !== 'page' && $article_helper->is_author_supported( $post_type ) ) {
$field_defs['schema_article_type']['default'] = WPSEO_Options::get( 'schema-article-type-' . $post_type );
}
else {
unset( $field_defs['schema_article_type'] );
}
break;
}
/**
......@@ -610,25 +641,40 @@ class WPSEO_Meta {
}
}
$custom = get_post_custom( $postid ); // Array of strings or empty array.
$custom = get_post_custom( $postid ); // Array of strings or empty array.
$table_key = self::$meta_prefix . $key;
if ( isset( $custom[ self::$meta_prefix . $key ][0] ) ) {
$unserialized = maybe_unserialize( $custom[ self::$meta_prefix . $key ][0] );
if ( $custom[ self::$meta_prefix . $key ][0] === $unserialized ) {
return $custom[ self::$meta_prefix . $key ][0];
// Populate the field_def using the field_index lookup array.
$field_def = [];
if ( isset( self::$fields_index[ $table_key ] ) ) {
$field_def = self::$meta_fields[ self::$fields_index[ $table_key ]['subset'] ][ self::$fields_index[ $table_key ]['key'] ];
}
// Check if we have a custom post meta entry.
if ( isset( $custom[ $table_key ][0] ) ) {
$unserialized = maybe_unserialize( $custom[ $table_key ][0] );
// Check if it is already unserialized.
if ( $custom[ $table_key ][0] === $unserialized ) {
return $custom[ $table_key ][0];
}
if ( isset( self::$fields_index[ self::$meta_prefix . $key ] ) ) {
$field_def = self::$meta_fields[ self::$fields_index[ self::$meta_prefix . $key ]['subset'] ][ self::$fields_index[ self::$meta_prefix . $key ]['key'] ];
if ( isset( $field_def['serialized'] ) && $field_def['serialized'] === true ) {
// Ok, serialize value expected/allowed.
return $unserialized;
}
// Check whether we need to unserialize it.
if ( isset( $field_def['serialized'] ) && $field_def['serialized'] === true ) {
// Ok, serialize value expected/allowed.
return $unserialized;
}
}
// Meta was either not found or found, but object/array while not allowed to be.
if ( isset( self::$defaults[ self::$meta_prefix . $key ] ) ) {
// Update the default value to the current post type.
switch ( $key ) {
case 'schema_page_type':
case 'schema_article_type':
return '';
}
return self::$defaults[ self::$meta_prefix . $key ];
}
......
......@@ -1140,9 +1140,10 @@ SVG;
$wpseo_admin_l10n = [
'displayAdvancedTab' => WPSEO_Capability_Utils::current_user_can( 'wpseo_edit_advanced_metadata' ) || ! WPSEO_Options::get( 'disableadvanced_meta' ),
'noIndex' => ! ! $no_index,
'noIndex' => (bool) $no_index,
'isPremium' => self::is_yoast_seo_premium(),
'isPostType' => ! ! get_post_type(),
'isPostType' => (bool) get_post_type(),
'postType' => get_post_type(),
'postTypeNamePlural' => ( $page_type === 'post' ) ? $label_object->label : $label_object->name,
'postTypeNameSingular' => ( $page_type === 'post' ) ? $label_object->labels->singular_name : $label_object->singular_name,
'breadcrumbsDisabled' => WPSEO_Options::get( 'breadcrumbs-enable', false ) !== true && ! current_theme_supports( 'yoast-seo-breadcrumbs' ),
......
......@@ -5,6 +5,8 @@
* @package WPSEO\Internals\Options
*/
use Yoast\WP\SEO\Config\Schema_Types;
/**
* Option: wpseo_titles.
*/
......@@ -91,6 +93,9 @@ class WPSEO_Option_Titles extends WPSEO_Option {
* - 'metadesc-tax-' . $tax->name => ''; // Text field.
* - 'noindex-tax-' . $tax->name => false;
* - 'display-metabox-tax-' . $tax->name => false;
*
* - 'schema-page-type-' . $pt->name => 'WebPage';
* - 'schema-article-type-' . $pt->name => 'Article';
*/
];
......@@ -114,6 +119,8 @@ class WPSEO_Option_Titles extends WPSEO_Option {
'bctitle-ptarchive-',
'post_types-',
'taxonomy-',
'schema-page-type-',
'schema-article-type-',
];
/**
......@@ -262,6 +269,8 @@ class WPSEO_Option_Titles extends WPSEO_Option {
$enriched_defaults[ 'noindex-' . $pt->name ] = false;
$enriched_defaults[ 'display-metabox-pt-' . $pt->name ] = true;
$enriched_defaults[ 'post_types-' . $pt->name . '-maintax' ] = 0; // Select box.
$enriched_defaults[ 'schema-page-type-' . $pt->name ] = 'WebPage';
$enriched_defaults[ 'schema-article-type-' . $pt->name ] = ( $pt->name === 'post' ) ? 'Article' : 'None';
if ( ! $pt->_builtin && WPSEO_Post_Type::has_archive( $pt ) ) {
$enriched_defaults[ 'title-ptarchive-' . $pt->name ] = $archive . ' %%page%% %%sep%% %%sitename%%'; // Text field.
......@@ -510,6 +519,31 @@ class WPSEO_Option_Titles extends WPSEO_Option {
}
break;
case 'schema-page-type-':
if ( isset( $dirty[ $key ] ) && is_string( $dirty[ $key ] ) ) {
if ( array_key_exists( $dirty[ $key ], Schema_Types::PAGE_TYPES ) ) {
$clean[ $key ] = $dirty[ $key ];
}
else {
$defaults = $this->get_defaults();
$post_type = str_replace( $switch_key, '', $key );
$clean[ $key ] = $defaults[ $switch_key . $post_type ];
}
}
break;
case 'schema-article-type-':
if ( isset( $dirty[ $key ] ) && is_string( $dirty[ $key ] ) ) {
if ( array_key_exists( $dirty[ $key ], Schema_Types::ARTICLE_TYPES ) ) {
$clean[ $key ] = $dirty[ $key ];
}
else {
$defaults = $this->get_defaults();
$post_type = str_replace( $switch_key, '', $key );
$clean[ $key ] = $defaults[ $switch_key . $post_type ];
}
}
break;
/*
* Boolean fields.
*/
......
......@@ -157,9 +157,11 @@ abstract class WPSEO_Option {
* The option validation routines remove the default filters to prevent failing
* to insert an option if it's new. Let's add them back afterwards.
*/
add_action( 'add_option', [ $this, 'add_default_filters' ] ); // Adding back after INSERT.
add_action( 'add_option', [ $this, 'add_default_filters_if_same_option' ] ); // Adding back after INSERT.
add_action( 'update_option', [ $this, 'add_default_filters' ] );
add_action( 'update_option', [ $this, 'add_default_filters_if_same_option' ] );
add_filter( 'pre_update_option', [ $this, 'add_default_filters_if_not_changed' ], PHP_INT_MAX, 3 );
// Refills the cache when the option has been updated.
add_action( 'update_option_' . $this->option_name, [ 'WPSEO_Options', 'clear_cache' ], 10 );
......@@ -175,6 +177,7 @@ abstract class WPSEO_Option {
*/
add_action( 'add_site_option_' . $this->option_name, [ $this, 'add_default_filters' ] );
add_action( 'update_site_option_' . $this->option_name, [ $this, 'add_default_filters' ] );
add_filter( 'pre_update_site_option_' . $this->option_name, [ $this, 'add_default_filters_if_not_changed' ], PHP_INT_MAX, 3 );
// Refills the cache when the option has been updated.
add_action( 'update_site_option_' . $this->option_name, [ 'WPSEO_Options', 'clear_cache' ], 1, 0 );
......@@ -251,6 +254,43 @@ abstract class WPSEO_Option {
}
}
/**
* Adds back the default filters that were removed during validation if the option was changed.
* Checks if this option was changed to prevent constantly checking if filters are present.
*
* @param string $option_name The option name.
*
* @return void
*/
public function add_default_filters_if_same_option( $option_name ) {
if ( $option_name === $this->option_name ) {
$this->add_default_filters();
}
}
/**
* Adds back the default filters that were removed during validation if the option was not changed.
* This is because in that case the latter actions are not called and thus the filters are never
* added back.
*
* @param mixed $value The current value.
* @param string $option_name The option name.
* @param mixed $old_value The old value.
*
* @return string The current value.
*/
public function add_default_filters_if_not_changed( $value, $option_name, $old_value ) {
if ( $option_name !== $this->option_name ) {
return $value;
}
if ( $value === $old_value || maybe_serialize( $value ) === maybe_serialize( $old_value ) ) {
$this->add_default_filters();
}
return $value;
}
// @codingStandardsIgnoreStart
/**
* Validate webmaster tools & Pinterest verification strings.
......
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[1],{322: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 s(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),n());var s=o("#wp-admin-bar-wpseo-menu"),e=s.find(".yoast-issue-counter");e.length||(s.find("> a:first-child").append('<div class="yoast-issue-counter"/>'),e=s.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 n(){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")},s.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")},s.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),s=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",s),t.data("scrollHint",a),t.appendTo(s.find(".yoast-table-scrollable__inner")),e(t)}})}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),n(),function(){var o=jQuery(".wpseo-js-premium-indicator"),t=o.find("svg");if(o.hasClass("wpseo-premium-indicator--no")){var a=t.find("path"),s=o.css("backgroundColor");a.css("fill",s)}t.css("display","block"),o.css({backgroundColor:"transparent",width:"20px",height:"20px"})}(),i()})}(jQuery)}},[[322,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[1],{361: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 s(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),n());var s=o("#wp-admin-bar-wpseo-menu"),e=s.find(".yoast-issue-counter");e.length||(s.find("> a:first-child").append('<div class="yoast-issue-counter"/>'),e=s.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 n(){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")},s.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")},s.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),s=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",s),t.data("scrollHint",a),t.appendTo(s.find(".yoast-table-scrollable__inner")),e(t)}})}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),n(),function(){var o=jQuery(".wpseo-js-premium-indicator"),t=o.find("svg");if(o.hasClass("wpseo-premium-indicator--no")){var a=t.find("path"),s=o.css("backgroundColor");a.css("fill",s)}t.css("display","block"),o.css({backgroundColor:"transparent",width:"20px",height:"20px"})}(),i()})}(jQuery)}},[[361,0]]]);
\ No newline at end of file
This diff is collapsed.
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[2],{323: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)}},[[323,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[2],{362: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)}},[[362,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[3],{324: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()})})}()}},[[324,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[3],{363: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()})})}()}},[[363,0]]]);
\ No newline at end of file
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([[5],{16:function(e,t){e.exports=window.yoast.styleGuide},2:function(e,t){e.exports=window.lodash},3:function(e,t){e.exports=window.wp.element},4:function(e,t){e.exports=window.wp.i18n},41: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(4),s=o(2);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)}},411: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=o(3),r=o(6),i=o(16),a=o(99),c=o(7),l=o(41);var u=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.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,c.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(a.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(r.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 i.colors["$color_"+e]||i.colors.$color_grey}}]),t}(),p=document.getElementById("yoast-seo-dashboard-widget");p&&((0,l.setYoastComponentsL10n)(),(0,s.render)(wp.element.createElement(u,null),p))},6:function(e,t){e.exports=window.yoast.componentsNew},7:function(e,t){e.exports=window.yoast.helpers},99:function(e,t){e.exports=window.yoast.analysisReport}},[[411,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[5],{103:function(e,t){e.exports=window.yoast.analysisReport},19:function(e,t){e.exports=window.yoast.styleGuide},2:function(e,t){e.exports=window.lodash},3:function(e,t){e.exports=window.wp.element},4:function(e,t){e.exports=window.wp.i18n},42: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(4),s=o(2);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)}},450: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=o(3),r=o(6),i=o(19),a=o(103),c=o(7),l=o(42);var u=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.Component),n(t,[{key:"getStatistics",value:function(){var e=this;wpseoApi.get("statistics",function(o){var n={};o&&o.seo_scores&&(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,c.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(a.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(r.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 i.colors["$color_"+e]||i.colors.$color_grey}}]),t}(),p=document.getElementById("yoast-seo-dashboard-widget");p&&((0,l.setYoastComponentsL10n)(),(0,s.render)(wp.element.createElement(u,null),p))},6:function(e,t){e.exports=window.yoast.componentsNew},7:function(e,t){e.exports=window.yoast.helpers}},[[450,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[6],{412: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)}},[[412,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[6],{451: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)}},[[451,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[7],{413:function(t,i,o){"use strict";jQuery("#posts-filter .tablenav.top").after('<div class="notice notice-info inline wpseo-filter-explanation"><p class="dashicons-before dashicons-lightbulb">'+yoastFilterExplanation.text+"</p></div>")}},[[413,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[7],{452:function(t,i,o){"use strict";jQuery("#posts-filter .tablenav.top").after('<div class="notice notice-info inline wpseo-filter-explanation"><p class="dashicons-before dashicons-lightbulb">'+yoastFilterExplanation.text+"</p></div>")}},[[452,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[11],{29:function(e,t){var n,a,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(){n=document.getElementById("a11y-speak-polite"),a=document.getElementById("a11y-speak-assertive"),null===n&&(n=r("polite")),null===a&&(a=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,a&&"assertive"===t?a.textContent=e:n&&(n.textContent=e)}},437:function(e,t,n){"use strict";var a=function(e){return e&&e.__esModule?e:{default:e}}(n(29));!function(e){function t(t){var n,o,r=e(".wrap > h1");t.length&&(n=t.map(function(e){return"<div class='"+e.type+" notice'><p>"+e.message+"</p></div>"}),r.after(n.join("")),o=wpseoNetworkAdminGlobalL10n.error_prefix,"updated"===t[0].type&&(o=wpseoNetworkAdminGlobalL10n.success_prefix),(0,a.default)(o.replace("%s",t[0].message),"assertive"))}function n(n){var a=e(this),o=a.find("[type='submit']:focus"),r=a.serialize();return n.preventDefault(),e(".wrap > .notice").remove(),o.length||(o=e(".wpseotab.active [type='submit']")),"action"===o.attr("name")&&(r=r.replace(/action=([a-zA-Z0-9_]+)/,"action="+o.val())),e.ajax({type:"POST",url:ajaxurl,data:r}).done(function(e){e.data&&t(e.data)}).fail(function(e){var n=e.responseJSON;n&&n.data&&t(n.data)}),!1}e(document).ready(function(){var t=e("#wpseo-conf");t.length&&t.on("submit",n)})}(jQuery)}},[[437,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[11],{30:function(e,t){var n,a,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(){n=document.getElementById("a11y-speak-polite"),a=document.getElementById("a11y-speak-assertive"),null===n&&(n=r("polite")),null===a&&(a=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,a&&"assertive"===t?a.textContent=e:n&&(n.textContent=e)}},476:function(e,t,n){"use strict";var a=function(e){return e&&e.__esModule?e:{default:e}}(n(30));!function(e){function t(t){var n,o,r=e(".wrap > h1");t.length&&(n=t.map(function(e){return"<div class='"+e.type+" notice'><p>"+e.message+"</p></div>"}),r.after(n.join("")),o=wpseoNetworkAdminGlobalL10n.error_prefix,"updated"===t[0].type&&(o=wpseoNetworkAdminGlobalL10n.success_prefix),(0,a.default)(o.replace("%s",t[0].message),"assertive"))}function n(n){var a=e(this),o=a.find("[type='submit']:focus"),r=a.serialize();return n.preventDefault(),e(".wrap > .notice").remove(),o.length||(o=e(".wpseotab.active [type='submit']")),"action"===o.attr("name")&&(r=r.replace(/action=([a-zA-Z0-9_]+)/,"action="+o.val())),e.ajax({type:"POST",url:ajaxurl,data:r}).done(function(e){e.data&&t(e.data)}).fail(function(e){var n=e.responseJSON;n&&n.data&&t(n.data)}),!1}e(document).ready(function(){var t=e("#wpseo-conf");t.length&&t.on("submit",n)})}(jQuery)}},[[476,0]]]);
\ No newline at end of file
This diff is collapsed.
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[13],{451:function(t,n,i){"use strict";jQuery(function(t){var n=t(location).attr("pathname").split("/").pop(),i="edit-tags.php"===n?"slug":"post_name",e=t(".wrap").children().eq(0),o=0,a=[];function r(n){a.includes(n)||(a.push(n),t(n).insertAfter(e))}function p(){t.post(ajaxurl,{action:"yoast_get_notifications",version:2},function(t){""!==t&&(o=0,JSON.parse(t).map(r));o<20&&""===t&&(o++,setTimeout(p,500))})}function u(){var n=t("tr.inline-editor");return function(n){return t("#inline_"+n).find("."+i).html()}(function(t){return 0===t.length||""===t?"":t.attr("id").replace("edit-","")}(n))!==n.find("input[name="+i+"]").val()}["edit.php","edit-tags.php"].includes(n)&&(t("#inline-edit input").on("keydown",function(t){13===t.which&&u()&&p()}),t(".button-primary").click(function(n){"save-order"!==t(n.target).attr("id")&&u()&&p()})),"edit-tags.php"===n&&t(document).on("ajaxComplete",function(t,n,i){i.data.indexOf("action=delete-tag")>-1&&p()})}(jQuery))}},[[451,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[13],{490:function(t,n,i){"use strict";jQuery(function(t){var n=t(location).attr("pathname").split("/").pop(),i="edit-tags.php"===n?"slug":"post_name",e=t(".wrap").children().eq(0),o=0,a=[];function r(n){a.includes(n)||(a.push(n),t(n).insertAfter(e))}function p(){t.post(ajaxurl,{action:"yoast_get_notifications",version:2},function(t){""!==t&&(o=0,JSON.parse(t).map(r));o<20&&""===t&&(o++,setTimeout(p,500))})}function u(){var n=t("tr.inline-editor");return function(n){return t("#inline_"+n).find("."+i).html()}(function(t){return 0===t.length||""===t?"":t.attr("id").replace("edit-","")}(n))!==n.find("input[name="+i+"]").val()}["edit.php","edit-tags.php"].includes(n)&&(t("#inline-edit input").on("keydown",function(t){13===t.which&&u()&&p()}),t(".button-primary").click(function(n){"save-order"!==t(n.target).attr("id")&&u()&&p()})),"edit-tags.php"===n&&t(document).on("ajaxComplete",function(t,n,i){i.data.indexOf("action=delete-tag")>-1&&p()})}(jQuery))}},[[490,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[14],{2:function(e,t){e.exports=window.lodash},277:function(e,t){e.exports=window.yoast.jed},452:function(e,t,o){"use strict";var s=function(e){return e&&e.__esModule?e:{default:e}}(o(277)),n=o(8),r=o(2);!function(e){var t=new s.default({domain:"js-text-analysis",locale_data:{"js-text-analysis":{"":{}}}}),o=function(t){this.totalCount=t,this.oncomplete=!1,this.setupAssessors(),e("#wpseo_count_total").html(t),jQuery("#wpseo_progressbar").progressbar({value:0})};function a(e){var t=parseInt(e.posts,10),s=parseInt(e.terms,10),n=new o(t+s);n.start(t,"post","post_id",function(){n.start(s,"term","term_id",!1)})}o.prototype.setupAssessors=function(){var e=new n.ContentAssessor(t),o=new n.TaxonomyAssessor(t);this.validAssessors={post:e,term:o}},o.prototype.start=function(e,t,o,s){if(!this.validAssessors.hasOwnProperty(t))throw new Error("Unknown fetch type of "+t+" given.");this.fetchType=t,this.itemsToFetch=e,this.idField=o,this.oncomplete=s,this.assessor=this.validAssessors[t],this.getItemsToRecalculate(1)},o.prototype.updateProgressBar=function(e){var t=jQuery("#wpseo_count").text(),o=parseInt(t,10)+e,s=o*(100/this.totalCount);jQuery("#wpseo_progressbar").progressbar("value",s),this.updateCountElement(o)},o.prototype.updateCountElement=function(e){jQuery("#wpseo_count").html(e)},o.prototype.calculateScores=function(e,t){for(var o=[],s=0;s<e;s++)o.push(this.getScore(t[s]));return o},o.prototype.getScore=function(e){return{item_id:this.getItemID(e),taxonomy:e.taxonomy?e.taxonomy:"",score:this.calculateItemScore(e)}},o.prototype.getItemID=function(e){return this.itemsToFetch--,e[this.idField]},o.prototype.calculateItemScore=function(e){var t=new n.Paper(e.text,{keyword:e.keyword,url:e.url,locale:wpseoAdminL10n.contentLocale,description:e.meta,title:e.pageTitle}),o=this.assessor;return o.assess(t),o.calculateOverallScore()},o.prototype.parseResponse=function(e){if(""!==e&&null!==e){if(!(0,r.isUndefined)(e.total_items)){var t=this.calculateScores(e.total_items,e.items);this.sendScores(t),this.updateProgressBar(e.total_items)}return(0,r.isUndefined)(e.next_page)?this.onCompleteRequest():this.getItemsToRecalculate(e.next_page),!0}this.onCompleteRequest()},o.prototype.onCompleteRequest=function(){!1!==this.oncomplete&&(this.oncomplete(),this.oncomplete=!1)},o.prototype.sendScores=function(e){jQuery.post(ajaxurl,{action:"wpseo_update_score",nonce:jQuery("#wpseo_recalculate_nonce").val(),scores:e,type:this.fetchType})},o.prototype.getItemsToRecalculate=function(e){jQuery.post(ajaxurl,{action:"wpseo_recalculate_scores",nonce:jQuery("#wpseo_recalculate_nonce").val(),paged:e,type:this.fetchType},this.parseResponse.bind(this),"json")},e(function(){var t=jQuery("#wpseo_recalculate_link");(0,r.isUndefined)(t)||(t.click(function(){jQuery("#wpseo_count").text(0),e.post(ajaxurl,{action:"wpseo_recalculate_total",nonce:jQuery("#wpseo_recalculate_nonce").val()},a,"json")}),t.data("open")&&t.trigger("click"))})}(jQuery)},8:function(e,t){e.exports=window.yoast.analysis}},[[452,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[14],{2:function(e,t){e.exports=window.lodash},293:function(e,t){e.exports=window.yoast.jed},491:function(e,t,o){"use strict";var s=function(e){return e&&e.__esModule?e:{default:e}}(o(293)),n=o(8),r=o(2);!function(e){var t=new s.default({domain:"js-text-analysis",locale_data:{"js-text-analysis":{"":{}}}}),o=function(t){this.totalCount=t,this.oncomplete=!1,this.setupAssessors(),e("#wpseo_count_total").html(t),jQuery("#wpseo_progressbar").progressbar({value:0})};function a(e){var t=parseInt(e.posts,10),s=parseInt(e.terms,10),n=new o(t+s);n.start(t,"post","post_id",function(){n.start(s,"term","term_id",!1)})}o.prototype.setupAssessors=function(){var e=new n.ContentAssessor(t),o=new n.TaxonomyAssessor(t);this.validAssessors={post:e,term:o}},o.prototype.start=function(e,t,o,s){if(!this.validAssessors.hasOwnProperty(t))throw new Error("Unknown fetch type of "+t+" given.");this.fetchType=t,this.itemsToFetch=e,this.idField=o,this.oncomplete=s,this.assessor=this.validAssessors[t],this.getItemsToRecalculate(1)},o.prototype.updateProgressBar=function(e){var t=jQuery("#wpseo_count").text(),o=parseInt(t,10)+e,s=o*(100/this.totalCount);jQuery("#wpseo_progressbar").progressbar("value",s),this.updateCountElement(o)},o.prototype.updateCountElement=function(e){jQuery("#wpseo_count").html(e)},o.prototype.calculateScores=function(e,t){for(var o=[],s=0;s<e;s++)o.push(this.getScore(t[s]));return o},o.prototype.getScore=function(e){return{item_id:this.getItemID(e),taxonomy:e.taxonomy?e.taxonomy:"",score:this.calculateItemScore(e)}},o.prototype.getItemID=function(e){return this.itemsToFetch--,e[this.idField]},o.prototype.calculateItemScore=function(e){var t=new n.Paper(e.text,{keyword:e.keyword,url:e.url,locale:wpseoAdminL10n.contentLocale,description:e.meta,title:e.pageTitle}),o=this.assessor;return o.assess(t),o.calculateOverallScore()},o.prototype.parseResponse=function(e){if(""!==e&&null!==e){if(!(0,r.isUndefined)(e.total_items)){var t=this.calculateScores(e.total_items,e.items);this.sendScores(t),this.updateProgressBar(e.total_items)}return(0,r.isUndefined)(e.next_page)?this.onCompleteRequest():this.getItemsToRecalculate(e.next_page),!0}this.onCompleteRequest()},o.prototype.onCompleteRequest=function(){!1!==this.oncomplete&&(this.oncomplete(),this.oncomplete=!1)},o.prototype.sendScores=function(e){jQuery.post(ajaxurl,{action:"wpseo_update_score",nonce:jQuery("#wpseo_recalculate_nonce").val(),scores:e,type:this.fetchType})},o.prototype.getItemsToRecalculate=function(e){jQuery.post(ajaxurl,{action:"wpseo_recalculate_scores",nonce:jQuery("#wpseo_recalculate_nonce").val(),paged:e,type:this.fetchType},this.parseResponse.bind(this),"json")},e(function(){var t=jQuery("#wpseo_recalculate_link");(0,r.isUndefined)(t)||(t.click(function(){jQuery("#wpseo_count").text(0),e.post(ajaxurl,{action:"wpseo_recalculate_total",nonce:jQuery("#wpseo_recalculate_nonce").val()},a,"json")}),t.data("open")&&t.trigger("click"))})}(jQuery)},8:function(e,t){e.exports=window.yoast.analysis}},[[491,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[15],{29:function(e,t){var n,o,r="",a=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(){n=document.getElementById("a11y-speak-polite"),o=document.getElementById("a11y-speak-assertive"),null===n&&(n=a("polite")),null===o&&(o=a("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," "),r===e&&(e+=" "),r=e,o&&"assertive"===t?o.textContent=e:n&&(n.textContent=e)}},453:function(e,t,n){"use strict";var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(n(29));var a=yoastReindexLinksData.data,i=!1,s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=jQuery("#wpseo_count_index_links"),this.progressbarTarget=jQuery("#wpseo_index_links_progressbar").progressbar({value:0}),this.total=parseInt(t,10),this.totalProcessed=0}return o(e,[{key:"update",value:function(e){this.totalProcessed+=e;var t=this.totalProcessed*(100/this.total);this.progressbarTarget.progressbar("value",Math.round(t)),this.element.html(this.totalProcessed)}},{key:"complete",value:function(){this.progressbarTarget.progressbar("value",100)}}]),e}();function u(){return new Promise(function(e){!function e(t,n){jQuery.ajax({type:"GET",url:a.restApi.root+a.restApi.endpoint,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",a.restApi.nonce)},success:function(o){var r=parseInt(o,10);if(0!==r)return t.update(r),void e(t,n);t.complete(),n()}})}(new s(a.amount),e)})}function l(){i=!0,(0,r.default)(a.l10n.calculationCompleted),jQuery("#reindexLinks").html(a.message.indexingCompleted),tb_remove()}function c(){jQuery("#general-tab").click(),!1===i&&jQuery("#openLinkIndexing").click()}jQuery(function(){var e=!1;jQuery(".yoast-js-calculate-index-links--all ").on("click",function(){!1===e&&(function(){(0,r.default)(a.l10n.calculationInProgress);var e=[];e.push(u()),Promise.all(e).then(l)}(),e=!0)}),jQuery("#noticeRunLinkIndex").click(c),-1!==window.location.href.indexOf("&reIndexLinks=1")&&jQuery(c)})}},[[453,0]]]);
\ No newline at end of file
(window.yoastWebpackJsonp=window.yoastWebpackJsonp||[]).push([[15],{30:function(e,t){var n,o,r="",a=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(){n=document.getElementById("a11y-speak-polite"),o=document.getElementById("a11y-speak-assertive"),null===n&&(n=a("polite")),null===o&&(o=a("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," "),r===e&&(e+=" "),r=e,o&&"assertive"===t?o.textContent=e:n&&(n.textContent=e)}},492:function(e,t,n){"use strict";var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(n(30));var a=yoastReindexLinksData.data,i=!1,s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=jQuery("#wpseo_count_index_links"),this.progressbarTarget=jQuery("#wpseo_index_links_progressbar").progressbar({value:0}),this.total=parseInt(t,10),this.totalProcessed=0}return o(e,[{key:"update",value:function(e){this.totalProcessed+=e;var t=this.totalProcessed*(100/this.total);this.progressbarTarget.progressbar("value",Math.round(t)),this.element.html(this.totalProcessed)}},{key:"complete",value:function(){this.progressbarTarget.progressbar("value",100)}}]),e}();function u(){return new Promise(function(e){!function e(t,n){jQuery.ajax({type:"GET",url:a.restApi.root+a.restApi.endpoint,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",a.restApi.nonce)},success:function(o){var r=parseInt(o,10);if(0!==r)return t.update(r),void e(t,n);t.complete(),n()}})}(new s(a.amount),e)})}function l(){i=!0,(0,r.default)(a.l10n.calculationCompleted),jQuery("#reindexLinks").html(a.message.indexingCompleted),tb_remove()}function c(){jQuery("#general-tab").click(),!1===i&&jQuery("#openLinkIndexing").click()}jQuery(function(){var e=!1;jQuery(".yoast-js-calculate-index-links--all ").on("click",function(){!1===e&&(function(){(0,r.default)(a.l10n.calculationInProgress);var e=[];e.push(u()),Promise.all(e).then(l)}(),e=!0)}),jQuery("#noticeRunLinkIndex").click(c),-1!==window.location.href.indexOf("&reIndexLinks=1")&&jQuery(c)})}},[[492,0]]]);
\ 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.
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