plugin updates
This commit is contained in:
@@ -112,10 +112,6 @@ class WPSEO_Admin_Pages {
|
||||
if ( in_array( $page, [ WPSEO_Admin::PAGE_IDENTIFIER, 'wpseo_workouts' ], true ) ) {
|
||||
wp_enqueue_media();
|
||||
|
||||
$script_data['media'] = [
|
||||
'choose_image' => __( 'Use Image', 'wordpress-seo' ),
|
||||
];
|
||||
|
||||
$script_data['userEditUrl'] = add_query_arg( 'user_id', '{user_id}', admin_url( 'user-edit.php' ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const CURRENT_RELEASE = '19.0.0';
|
||||
public const CURRENT_RELEASE = '19.2.0';
|
||||
|
||||
/**
|
||||
* The minimally supported version of Gutenberg by the plugin.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const MINIMUM_SUPPORTED = '19.0.0';
|
||||
public const MINIMUM_SUPPORTED = '19.2.0';
|
||||
|
||||
/**
|
||||
* Holds the current version.
|
||||
|
||||
@@ -721,6 +721,8 @@ class Yoast_Form {
|
||||
* Media input.
|
||||
*
|
||||
* @since 2.0
|
||||
* @deprecated 23.5
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $variable Option name.
|
||||
* @param string $label Label message.
|
||||
@@ -729,6 +731,9 @@ class Yoast_Form {
|
||||
* @return void
|
||||
*/
|
||||
public function media_input( $variable, $label, $attr = [] ) {
|
||||
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 23.5' );
|
||||
|
||||
$val = $this->get_field_value( $variable, '' );
|
||||
$id_value = $this->get_field_value( $variable . '_id', '' );
|
||||
|
||||
@@ -749,8 +754,6 @@ class Yoast_Form {
|
||||
|
||||
$id_field_id = 'wpseo_' . $var_esc . '_id';
|
||||
|
||||
$disabled_attribute = $this->get_disabled_attribute( $variable, $attr );
|
||||
|
||||
echo '<span>';
|
||||
echo '<input',
|
||||
' class="textinput"',
|
||||
@@ -760,22 +763,6 @@ class Yoast_Form {
|
||||
' value="', esc_attr( $val ), '"',
|
||||
' readonly="readonly"',
|
||||
' /> ';
|
||||
echo '<input',
|
||||
' id="wpseo_', $var_esc, '_button"', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- output escaped before.
|
||||
' class="wpseo_image_upload_button button"',
|
||||
' type="button"',
|
||||
' value="', esc_attr__( 'Upload Image', 'wordpress-seo' ), '"',
|
||||
' data-target-id="', esc_attr( $id_field_id ), '"',
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $disabled_attribute output is hardcoded.
|
||||
$disabled_attribute,
|
||||
' /> ';
|
||||
echo '<input',
|
||||
' class="wpseo_image_remove_button button"',
|
||||
' type="button"',
|
||||
' value="', esc_attr__( 'Clear Image', 'wordpress-seo' ), '"',
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $disabled_attribute output is hardcoded.
|
||||
$disabled_attribute,
|
||||
' />';
|
||||
echo '<input',
|
||||
' type="hidden"',
|
||||
' id="', esc_attr( $id_field_id ), '"',
|
||||
|
||||
@@ -54,7 +54,6 @@ class WPSEO_Metabox_Formatter {
|
||||
$defaults = [
|
||||
'author_name' => get_the_author_meta( 'display_name' ),
|
||||
'sitewide_social_image' => WPSEO_Options::get( 'og_default_image' ),
|
||||
'translations' => $this->get_translations(),
|
||||
'keyword_usage' => [],
|
||||
'title_template' => '',
|
||||
'metadesc_template' => '',
|
||||
@@ -68,100 +67,6 @@ class WPSEO_Metabox_Formatter {
|
||||
'articleTypeOptions' => $schema_types->get_article_type_options(),
|
||||
],
|
||||
'twitterCardType' => 'summary_large_image',
|
||||
'publish_box' => [
|
||||
'labels' => [
|
||||
'keyword' => [
|
||||
'na' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
|
||||
__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-seo-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Not available', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'bad' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
|
||||
__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-seo-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Needs improvement', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'ok' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
|
||||
__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-seo-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'OK', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'good' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
|
||||
__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-seo-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
],
|
||||
'content' => [
|
||||
'na' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
|
||||
__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-readability-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Not available', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'bad' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
|
||||
__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-readability-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Needs improvement', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'ok' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
|
||||
__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-readability-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'OK', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'good' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
|
||||
__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-readability-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
],
|
||||
'inclusive-language' => [
|
||||
'na' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the inclusive language score. */
|
||||
__( '%1$sInclusive language%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-inclusive-language-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Not available', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'bad' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the inclusive language score. */
|
||||
__( '%1$sInclusive language%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-inclusive-language-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Needs improvement', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'ok' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the inclusive language score. */
|
||||
__( '%1$sInclusive language%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-inclusive-language-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Potentially non-inclusive', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
'good' => sprintf(
|
||||
/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the inclusive language score. */
|
||||
__( '%1$sInclusive language%2$s: %3$s', 'wordpress-seo' ),
|
||||
'<a href="#yoast-inclusive-language-analysis-collapsible-metabox">',
|
||||
'</a>',
|
||||
'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
|
||||
),
|
||||
],
|
||||
],
|
||||
],
|
||||
/**
|
||||
* Filter to determine if the markers should be enabled or not.
|
||||
*
|
||||
@@ -183,24 +88,4 @@ class WPSEO_Metabox_Formatter {
|
||||
$enabled_features = $enabled_features_repo->get_enabled_features()->parse_to_legacy_array();
|
||||
return array_merge( $defaults, $enabled_features );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Jed compatible YoastSEO.js translations.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
private function get_translations() {
|
||||
$locale = get_user_locale();
|
||||
|
||||
$file = WPSEO_PATH . 'languages/wordpress-seo-' . $locale . '.json';
|
||||
if ( file_exists( $file ) ) {
|
||||
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Retrieving a local file.
|
||||
$file = file_get_contents( $file );
|
||||
if ( is_string( $file ) && $file !== '' ) {
|
||||
return json_decode( $file, true );
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,6 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
||||
add_action( 'wp_insert_post', [ $this, 'save_postdata' ] );
|
||||
add_action( 'edit_attachment', [ $this, 'save_postdata' ] );
|
||||
add_action( 'add_attachment', [ $this, 'save_postdata' ] );
|
||||
add_action( 'admin_init', [ $this, 'translate_meta_boxes' ] );
|
||||
|
||||
$this->editor = new WPSEO_Metabox_Editor();
|
||||
$this->editor->register_hooks();
|
||||
@@ -168,9 +167,14 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
||||
* IMPORTANT: if you want to add a new string (option) somewhere, make sure you add that array key to
|
||||
* the main meta box definition array in the class WPSEO_Meta() as well!!!!
|
||||
*
|
||||
* @deprecated 23.5
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function translate_meta_boxes() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 23.5' );
|
||||
|
||||
WPSEO_Meta::$meta_fields['general']['title']['title'] = __( 'SEO title', 'wordpress-seo' );
|
||||
WPSEO_Meta::$meta_fields['general']['metadesc']['title'] = __( 'Meta description', 'wordpress-seo' );
|
||||
|
||||
@@ -210,7 +214,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
||||
WPSEO_Meta::$meta_fields['advanced']['redirect']['title'] = __( '301 Redirect', 'wordpress-seo' );
|
||||
WPSEO_Meta::$meta_fields['advanced']['redirect']['description'] = __( 'The URL that this page should redirect to.', 'wordpress-seo' );
|
||||
|
||||
do_action( 'wpseo_tab_translate' );
|
||||
do_action_deprecated( 'wpseo_tab_translate', [], 'Yoast SEO 23.5', '', 'WPSEO_Metabox::translate_meta_boxes is deprecated.' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -623,31 +627,6 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
||||
unset( $val, $option, $checked );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'upload':
|
||||
$content .= '<input'
|
||||
. ' id="' . $esc_form_key . '"'
|
||||
. ' type="text"'
|
||||
. ' size="36"'
|
||||
. ' class="' . $class . '"'
|
||||
. ' name="' . $esc_form_key . '"'
|
||||
. ' value="' . esc_attr( $meta_value ) . '"' . $aria_describedby
|
||||
. ' readonly="readonly"'
|
||||
. ' /> ';
|
||||
$content .= '<input'
|
||||
. ' id="' . esc_attr( $esc_form_key ) . '_button"'
|
||||
. ' class="wpseo_image_upload_button button"'
|
||||
. ' data-target="' . esc_attr( $esc_form_key ) . '"'
|
||||
. ' data-target-id="' . esc_attr( $esc_form_key ) . '-id"'
|
||||
. ' type="button"'
|
||||
. ' value="' . esc_attr__( 'Upload Image', 'wordpress-seo' ) . '"'
|
||||
. ' /> ';
|
||||
$content .= '<input'
|
||||
. ' class="wpseo_image_remove_button button"'
|
||||
. ' type="button"'
|
||||
. ' value="' . esc_attr__( 'Clear Image', 'wordpress-seo' ) . '"'
|
||||
. ' />';
|
||||
break;
|
||||
}
|
||||
|
||||
$html = '';
|
||||
@@ -881,7 +860,6 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
||||
|
||||
$plugins_script_data = [
|
||||
'replaceVars' => [
|
||||
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
|
||||
'replace_vars' => $this->get_replace_vars(),
|
||||
'hidden_replace_vars' => $this->get_hidden_replace_vars(),
|
||||
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
|
||||
@@ -907,8 +885,6 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
||||
$woocommerce_seo_active = is_plugin_active( $addon_manager->get_plugin_file( WPSEO_Addon_Manager::WOOCOMMERCE_SLUG ) );
|
||||
|
||||
$script_data = [
|
||||
// @todo replace this translation with JavaScript translations.
|
||||
'media' => [ 'choose_image' => __( 'Use Image', 'wordpress-seo' ) ],
|
||||
'metabox' => $this->get_metabox_script_data(),
|
||||
'userLanguageCode' => WPSEO_Language_Utils::get_language( get_user_locale() ),
|
||||
'isPost' => true,
|
||||
@@ -938,13 +914,8 @@ class WPSEO_Metabox extends WPSEO_Meta {
|
||||
$site_information->set_permalink( $this->get_permalink() );
|
||||
$script_data = array_merge_recursive( $site_information->get_legacy_site_information(), $script_data );
|
||||
|
||||
if ( post_type_supports( get_post_type(), 'thumbnail' ) ) {
|
||||
if ( ! $is_block_editor && post_type_supports( get_post_type(), 'thumbnail' ) ) {
|
||||
$asset_manager->enqueue_style( 'featured-image' );
|
||||
|
||||
// @todo replace this translation with JavaScript translations.
|
||||
$script_data['featuredImage'] = [
|
||||
'featured_image_notice' => __( 'SEO issue: The featured image should be at least 200 by 200 pixels to be picked up by Facebook and other social media sites.', 'wordpress-seo' ),
|
||||
];
|
||||
}
|
||||
|
||||
$asset_manager->localize_script( $post_edit_handle, 'wpseoScriptData', $script_data );
|
||||
|
||||
@@ -109,30 +109,6 @@ class WPSEO_Taxonomy_Fields_Presenter {
|
||||
}
|
||||
$field .= '<textarea class="large-text" rows="' . esc_attr( $rows ) . '" id="' . $field_name . '" name="' . $field_name . '"' . $aria_describedby . '>' . esc_textarea( $field_value ) . '</textarea>';
|
||||
break;
|
||||
case 'upload':
|
||||
$field .= '<input'
|
||||
. ' id="' . $field_name . '"'
|
||||
. ' type="text"'
|
||||
. ' size="36"'
|
||||
. ' name="' . $field_name . '"'
|
||||
. ' value="' . esc_attr( $field_value ) . '"' . $aria_describedby . ''
|
||||
. ' readonly="readonly"'
|
||||
. ' /> ';
|
||||
$field .= '<input'
|
||||
. ' id="' . esc_attr( $field_name ) . '_button"'
|
||||
. ' class="wpseo_image_upload_button button"'
|
||||
. ' data-target="' . esc_attr( $field_name ) . '"'
|
||||
. ' data-target-id="hidden_' . esc_attr( $field_name ) . '-id"'
|
||||
. ' type="button"'
|
||||
. ' value="' . esc_attr__( 'Upload Image', 'wordpress-seo' ) . '"'
|
||||
. ' /> ';
|
||||
$field .= '<input'
|
||||
. ' id="' . esc_attr( $field_name ) . '_button"'
|
||||
. ' class="wpseo_image_remove_button button"'
|
||||
. ' type="button"'
|
||||
. ' value="' . esc_attr__( 'Clear Image', 'wordpress-seo' ) . '"'
|
||||
. ' />';
|
||||
break;
|
||||
case 'select':
|
||||
if ( is_array( $options ) && $options !== [] ) {
|
||||
$field .= '<select name="' . $field_name . '" id="' . $field_name . '"' . $aria_describedby . '>';
|
||||
|
||||
@@ -165,7 +165,6 @@ class WPSEO_Taxonomy {
|
||||
'analysis' => [
|
||||
'plugins' => [
|
||||
'replaceVars' => [
|
||||
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
|
||||
'replace_vars' => $this->get_replace_vars(),
|
||||
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
|
||||
'scope' => $this->determine_scope(),
|
||||
@@ -182,10 +181,6 @@ class WPSEO_Taxonomy {
|
||||
'log_level' => WPSEO_Utils::get_analysis_worker_log_level(),
|
||||
],
|
||||
],
|
||||
'media' => [
|
||||
// @todo replace this translation with JavaScript translations.
|
||||
'choose_image' => __( 'Use Image', 'wordpress-seo' ),
|
||||
],
|
||||
'metabox' => $this->localize_term_scraper_script( $tag_id ),
|
||||
'userLanguageCode' => WPSEO_Language_Utils::get_language( get_user_locale() ),
|
||||
'isTerm' => true,
|
||||
@@ -316,7 +311,6 @@ class WPSEO_Taxonomy {
|
||||
*/
|
||||
public function localize_replace_vars_script() {
|
||||
return [
|
||||
'no_parent_text' => __( '(no parent)', 'wordpress-seo' ),
|
||||
'replace_vars' => $this->get_replace_vars(),
|
||||
'recommended_replace_vars' => $this->get_recommended_replace_vars(),
|
||||
'scope' => $this->determine_scope(),
|
||||
|
||||
Reference in New Issue
Block a user