auto-patch 700-dev-dev01-2024-06-01T22_54_01
This commit is contained in:
@@ -197,14 +197,14 @@ class Minute_Control {
|
||||
public function inline_shortcode( $atts ) {
|
||||
global $post;
|
||||
|
||||
$data_url = isset( $atts['url'] ) ? esc_attr( 'data-url=' . esc_url( $atts['url'] ) ) : '';
|
||||
$data_url = isset( $atts['url'] ) ? $atts['url'] : '';
|
||||
|
||||
if ( is_archive() || is_front_page() || is_tag() ) {
|
||||
$data_url = esc_attr( 'data-url=' . get_permalink( $post->ID ) );
|
||||
$data_url = get_permalink( $post->ID );
|
||||
}
|
||||
|
||||
// Build container.
|
||||
return '<div class="sharethis-inline-share-buttons" ' . $data_url . '></div>';
|
||||
return '<div class="sharethis-inline-share-buttons" ' . ( false === empty( $data_url ) ? 'data-url="' . esc_url( $data_url ) . '"' : '' ) . '></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ Author URI: https://sharethis.com/
|
||||
Author: ShareThis
|
||||
Requires at least: 5.5
|
||||
Tested up to: 6.5.3
|
||||
Stable tag: 2.3.1
|
||||
Version: 2.3.1
|
||||
Stable tag: 2.3.2
|
||||
Version: 2.3.2
|
||||
|
||||
License: GPLv2 or later
|
||||
|
||||
@@ -73,6 +73,9 @@ We cache your ShareThis platform button configurations (social networks, button
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.3.2 =
|
||||
* Additional security checks.
|
||||
|
||||
= 2.3.1 =
|
||||
* Fix XSS security hole in shortcode
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Plugin Name: ShareThis Share Buttons
|
||||
* Plugin URI: https://sharethis.com/
|
||||
* Description: Grow your website traffic with share buttons for 40+ social channels including Facebook, LinkedIn, Twitter, WhatsApp, and more.
|
||||
* Version: 2.3.1
|
||||
* Version: 2.3.2
|
||||
* Author: ShareThis
|
||||
* Author URI: https://sharethis.com/
|
||||
* Text Domain: sharethis-share-buttons
|
||||
@@ -28,7 +28,7 @@
|
||||
/**
|
||||
* Plugin version constant.
|
||||
*/
|
||||
const SHARETHIS_SHARE_BUTTONS_VERSION = '2.3.1';
|
||||
const SHARETHIS_SHARE_BUTTONS_VERSION = '2.3.2';
|
||||
|
||||
if ( version_compare( phpversion(), '5.3', '>=' ) ) {
|
||||
require_once __DIR__ . '/instance.php';
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
/**
|
||||
* This class registers all the necessary styles and scripts.
|
||||
*
|
||||
* Also has methods for the enqueing of scripts and styles.
|
||||
* It automatically adds a prefix to the handle.
|
||||
*/
|
||||
class WPSEO_Admin_Asset_Manager {
|
||||
@@ -570,14 +571,6 @@ class WPSEO_Admin_Asset_Manager {
|
||||
self::PREFIX . 'admin-css',
|
||||
self::PREFIX . 'tailwind',
|
||||
'wp-components',
|
||||
self::PREFIX . 'additional-mentions',
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'additional-mentions',
|
||||
'src' => 'additional-mentions-' . $flat_version,
|
||||
'deps' => [
|
||||
self::PREFIX . 'tailwind',
|
||||
],
|
||||
],
|
||||
[
|
||||
@@ -651,10 +644,7 @@ class WPSEO_Admin_Asset_Manager {
|
||||
[
|
||||
'name' => 'new-settings',
|
||||
'src' => 'new-settings-' . $flat_version,
|
||||
'deps' => [
|
||||
self::PREFIX . 'tailwind',
|
||||
self::PREFIX . 'additional-mentions',
|
||||
],
|
||||
'deps' => [ self::PREFIX . 'tailwind' ],
|
||||
],
|
||||
[
|
||||
'name' => 'black-friday-banner',
|
||||
|
||||
@@ -127,30 +127,6 @@ class WPSEO_Admin_Pages {
|
||||
$this->asset_manager->enqueue_user_language_script();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves some variables that are needed for replacing variables in JS.
|
||||
*
|
||||
* @deprecated 20.3
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array The replacement and recommended replacement variables.
|
||||
*/
|
||||
public function get_replace_vars_script_data() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
|
||||
$replace_vars = new WPSEO_Replace_Vars();
|
||||
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
||||
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
||||
$replace_vars_list = $replace_vars->get_replacement_variables_list();
|
||||
|
||||
return [
|
||||
'replace_vars' => $replace_vars_list,
|
||||
'recommended_replace_vars' => $recommended_replace_vars->get_recommended_replacevars(),
|
||||
'editor_specific_replace_vars' => $editor_specific_replace_vars->get(),
|
||||
'shared_replace_vars' => $editor_specific_replace_vars->get_generic( $replace_vars_list ),
|
||||
'hidden_replace_vars' => $replace_vars->get_hidden_replace_vars(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueues and handles all the tool dependencies.
|
||||
*
|
||||
|
||||
@@ -1,249 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Customizer
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class with functionality to support WP SEO settings in WordPress Customizer.
|
||||
*/
|
||||
class WPSEO_Customizer {
|
||||
|
||||
/**
|
||||
* Holds the customize manager.
|
||||
*
|
||||
* @var WP_Customize_Manager
|
||||
*/
|
||||
protected $wp_customize;
|
||||
|
||||
/**
|
||||
* Template for the setting IDs used for the customizer.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $setting_template = 'wpseo_titles[%s]';
|
||||
|
||||
/**
|
||||
* Default arguments for the breadcrumbs customizer settings object.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $default_setting_args = [
|
||||
'default' => '',
|
||||
'type' => 'option',
|
||||
'transport' => 'refresh',
|
||||
];
|
||||
|
||||
/**
|
||||
* Default arguments for the breadcrumbs customizer control object.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $default_control_args = [
|
||||
'label' => '',
|
||||
'type' => 'text',
|
||||
'section' => 'wpseo_breadcrumbs_customizer_section',
|
||||
'settings' => '',
|
||||
'context' => '',
|
||||
];
|
||||
|
||||
/**
|
||||
* Construct Method.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'customize_register', [ $this, 'wpseo_customize_register' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to support WordPress Customizer.
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Manager class instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function wpseo_customize_register( $wp_customize ) {
|
||||
if ( ! WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->wp_customize = $wp_customize;
|
||||
|
||||
$this->breadcrumbs_section();
|
||||
$this->breadcrumbs_blog_show_setting();
|
||||
$this->breadcrumbs_separator_setting();
|
||||
$this->breadcrumbs_home_setting();
|
||||
$this->breadcrumbs_prefix_setting();
|
||||
$this->breadcrumbs_archiveprefix_setting();
|
||||
$this->breadcrumbs_searchprefix_setting();
|
||||
$this->breadcrumbs_404_setting();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the breadcrumbs section to the customizer.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function breadcrumbs_section() {
|
||||
$section_args = [
|
||||
/* translators: %s is the name of the plugin */
|
||||
'title' => sprintf( __( '%s Breadcrumbs', 'wordpress-seo' ), 'Yoast SEO' ),
|
||||
'priority' => 999,
|
||||
'active_callback' => [ $this, 'breadcrumbs_active_callback' ],
|
||||
];
|
||||
|
||||
$this->wp_customize->add_section( 'wpseo_breadcrumbs_customizer_section', $section_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the breadcrumbs are active.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function breadcrumbs_active_callback() {
|
||||
return current_theme_supports( 'yoast-seo-breadcrumbs' ) || WPSEO_Options::get( 'breadcrumbs-enable' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the breadcrumbs show blog checkbox.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function breadcrumbs_blog_show_setting() {
|
||||
$index = 'breadcrumbs-display-blog-page';
|
||||
$control_args = [
|
||||
'label' => __( 'Show blog page in breadcrumbs', 'wordpress-seo' ),
|
||||
'type' => 'checkbox',
|
||||
'active_callback' => [ $this, 'breadcrumbs_blog_show_active_cb' ],
|
||||
];
|
||||
|
||||
$this->add_setting_and_control( $index, $control_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not to show the breadcrumbs blog show option.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function breadcrumbs_blog_show_active_cb() {
|
||||
return get_option( 'show_on_front' ) === 'page';
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the breadcrumbs separator text field.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function breadcrumbs_separator_setting() {
|
||||
$index = 'breadcrumbs-sep';
|
||||
$control_args = [
|
||||
'label' => __( 'Breadcrumbs separator:', 'wordpress-seo' ),
|
||||
];
|
||||
$id = 'wpseo-breadcrumbs-separator';
|
||||
|
||||
$this->add_setting_and_control( $index, $control_args, $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the breadcrumbs home anchor text field.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function breadcrumbs_home_setting() {
|
||||
$index = 'breadcrumbs-home';
|
||||
$control_args = [
|
||||
'label' => __( 'Anchor text for the homepage:', 'wordpress-seo' ),
|
||||
];
|
||||
|
||||
$this->add_setting_and_control( $index, $control_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the breadcrumbs prefix text field.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function breadcrumbs_prefix_setting() {
|
||||
$index = 'breadcrumbs-prefix';
|
||||
$control_args = [
|
||||
'label' => __( 'Prefix for breadcrumbs:', 'wordpress-seo' ),
|
||||
];
|
||||
|
||||
$this->add_setting_and_control( $index, $control_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the breadcrumbs archive prefix text field.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function breadcrumbs_archiveprefix_setting() {
|
||||
$index = 'breadcrumbs-archiveprefix';
|
||||
$control_args = [
|
||||
'label' => __( 'Prefix for archive pages:', 'wordpress-seo' ),
|
||||
];
|
||||
|
||||
$this->add_setting_and_control( $index, $control_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the breadcrumbs search prefix text field.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function breadcrumbs_searchprefix_setting() {
|
||||
$index = 'breadcrumbs-searchprefix';
|
||||
$control_args = [
|
||||
'label' => __( 'Prefix for search result pages:', 'wordpress-seo' ),
|
||||
];
|
||||
|
||||
$this->add_setting_and_control( $index, $control_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the breadcrumb 404 prefix text field.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function breadcrumbs_404_setting() {
|
||||
$index = 'breadcrumbs-404crumb';
|
||||
$control_args = [
|
||||
'label' => __( 'Breadcrumb for 404 pages:', 'wordpress-seo' ),
|
||||
];
|
||||
|
||||
$this->add_setting_and_control( $index, $control_args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the customizer setting and control.
|
||||
*
|
||||
* @param string $index Array key index to use for the customizer setting.
|
||||
* @param array $control_args Customizer control object arguments.
|
||||
* Only those different from the default need to be passed.
|
||||
* @param string|null $id Optional. Customizer control object ID.
|
||||
* Will default to 'wpseo-' . $index.
|
||||
* @param array $custom_settings Optional. Customizer setting arguments.
|
||||
* Only those different from the default need to be passed.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function add_setting_and_control( $index, $control_args, $id = null, $custom_settings = [] ) {
|
||||
$setting = sprintf( $this->setting_template, $index );
|
||||
$control_args = array_merge( $this->default_control_args, $control_args );
|
||||
$control_args['settings'] = $setting;
|
||||
|
||||
$settings_args = $this->default_setting_args;
|
||||
if ( ! empty( $custom_settings ) ) {
|
||||
$settings_args = array_merge( $settings_args, $custom_settings );
|
||||
}
|
||||
|
||||
if ( ! isset( $id ) ) {
|
||||
$id = 'wpseo-' . $index;
|
||||
}
|
||||
|
||||
$this->wp_customize->add_setting( $setting, $settings_args );
|
||||
|
||||
$control = new WP_Customize_Control( $this->wp_customize, $id, $control_args );
|
||||
$this->wp_customize->add_control( $control );
|
||||
}
|
||||
}
|
||||
@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const CURRENT_RELEASE = '18.2.0';
|
||||
public const CURRENT_RELEASE = '18.4.0';
|
||||
|
||||
/**
|
||||
* The minimally supported version of Gutenberg by the plugin.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const MINIMUM_SUPPORTED = '18.2.0';
|
||||
public const MINIMUM_SUPPORTED = '18.4.0';
|
||||
|
||||
/**
|
||||
* Holds the current version.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"version": "22.8",
|
||||
"name": "yoast-seo/breadcrumbs",
|
||||
"title": "Yoast Breadcrumbs",
|
||||
"description": "Adds the Yoast SEO breadcrumbs to your template or content.",
|
||||
"category": "yoast-internal-linking-blocks",
|
||||
"icon": "admin-links",
|
||||
"keywords": [
|
||||
"SEO",
|
||||
"breadcrumbs",
|
||||
"internal linking",
|
||||
"site structure"
|
||||
],
|
||||
"textdomain": "wordpress-seo",
|
||||
"attributes": {
|
||||
"className": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"attributes": {}
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,6 @@
|
||||
"SEO",
|
||||
"Structured Data"
|
||||
],
|
||||
"supports": {
|
||||
"multiple": false
|
||||
},
|
||||
"textdomain": "wordpress-seo",
|
||||
"attributes": {
|
||||
"questions": {
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
.yst-replacevar__editor--description div{display:inline}.yst-replacevar__editor--description .yst-replacevar__editor-wrapper--description div{display:block}.yst-replacevar__editor--description .yst-root{margin-left:.25rem}.yst-replacevar__editor--description .yst-root .yst-badge{margin-bottom:.125rem}.yst-replacevar__editor--description .yst-root .yst-tooltip.yst-tooltip--top:before{--tw-translate-x:-14rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}
|
||||
@@ -1 +0,0 @@
|
||||
.yst-replacevar__editor--description div{display:inline}.yst-replacevar__editor--description .yst-replacevar__editor-wrapper--description div{display:block}.yst-replacevar__editor--description .yst-root{margin-right:.25rem}.yst-replacevar__editor--description .yst-root .yst-badge{margin-bottom:.125rem}.yst-replacevar__editor--description .yst-root .yst-tooltip.yst-tooltip--top:before{--tw-translate-x:-14rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -49,25 +49,4 @@ class WPSEO_Language_Utils {
|
||||
|
||||
return $language;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the l10n array for the knowledge graph company info missing.
|
||||
*
|
||||
* @deprecated 20.3
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array The l10n array.
|
||||
*/
|
||||
public static function get_knowledge_graph_company_info_missing_l10n() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
|
||||
|
||||
return [
|
||||
'URL' => esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/3r3' ) ),
|
||||
/* translators: 1: expands to a link opening tag; 2: expands to a link closing tag */
|
||||
'message' => esc_html__(
|
||||
'A company name and logo need to be set for structured data to work properly. Since you haven’t set these yet, we are using the site name and logo as default values. %1$sLearn more about the importance of structured data.%2$s',
|
||||
'wordpress-seo'
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -874,46 +874,6 @@ class WPSEO_Option_Titles extends WPSEO_Option {
|
||||
unset( $rename, $taxonomy_names, $post_type_names, $defaults, $tax, $old_prefix, $new_prefix );
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure the values of the variable option key options are cleaned as they
|
||||
* may be retained and would not be cleaned/validated then.
|
||||
*/
|
||||
if ( is_array( $option_value ) && $option_value !== [] ) {
|
||||
foreach ( $option_value as $key => $value ) {
|
||||
$switch_key = $this->get_switch_key( $key );
|
||||
|
||||
// Similar to validation routine - any changes made there should be made here too.
|
||||
switch ( $switch_key ) {
|
||||
/* Text fields. */
|
||||
case 'title-':
|
||||
case 'metadesc-':
|
||||
case 'bctitle-ptarchive-':
|
||||
$option_value[ $key ] = WPSEO_Utils::sanitize_text_field( $value );
|
||||
break;
|
||||
|
||||
case 'separator':
|
||||
if ( ! array_key_exists( $value, $this->get_separator_options() ) ) {
|
||||
$option_value[ $key ] = false;
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* Boolean fields.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Covers:
|
||||
* 'noindex-'
|
||||
* 'hideeditbox-'
|
||||
*/
|
||||
default:
|
||||
$option_value[ $key ] = WPSEO_Utils::validate_bool( $value );
|
||||
break;
|
||||
}
|
||||
}
|
||||
unset( $key, $value, $switch_key );
|
||||
}
|
||||
|
||||
return $option_value;
|
||||
}
|
||||
|
||||
|
||||
+147
-147
File diff suppressed because one or more lines are too long
+144
-146
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
(()=>{"use strict";var e={n:r=>{var s=r&&r.__esModule?()=>r.default:()=>r;return e.d(s,{a:s}),s},d:(r,s)=>{for(var t in s)e.o(s,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:s[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};const r=window.React,s=window.wp.blocks,t=window.wp.i18n,o=window.wp.serverSideRender;var n=e.n(o);(0,s.registerBlockType)("yoast-seo/breadcrumbs",{title:(0,t.__)("Yoast Breadcrumbs","wordpress-seo"),icon:"admin-links",category:"yoast-internal-linking-blocks",description:(0,t.__)("Adds the Yoast SEO breadcrumbs to your template or content.","wordpress-seo"),keywords:[(0,t.__)("seo","wordpress-seo"),(0,t.__)("breadcrumbs","wordpress-seo"),(0,t.__)("internal linking","wordpress-seo"),(0,t.__)("site structure","wordpress-seo")],example:{attributes:{}},edit:function(e){return(0,r.createElement)(n(),{block:"yoast-seo/breadcrumbs",attributes:e.attributes})},save:function(){return null}})})();
|
||||
(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,r=window.wp.blockEditor,s=window.wp.blocks,o=window.wp.serverSideRender;var a=e.n(o);const n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"version":"22.8","name":"yoast-seo/breadcrumbs","title":"Yoast Breadcrumbs","description":"Adds the Yoast SEO breadcrumbs to your template or content.","category":"yoast-internal-linking-blocks","icon":"admin-links","keywords":["SEO","breadcrumbs","internal linking","site structure"],"textdomain":"wordpress-seo","attributes":{"className":{"type":"string"}},"example":{"attributes":{}}}');(0,s.registerBlockType)(n,{edit:e=>{const s=(0,r.useBlockProps)();return(0,t.createElement)("div",{...s},(0,t.createElement)(a(),{block:"yoast-seo/breadcrumbs",attributes:e.attributes}))},save:()=>null})})();
|
||||
+24
-24
File diff suppressed because one or more lines are too long
+155
-157
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -7,4 +7,4 @@
|
||||
(0,h.__)("%s, %s and %s","wordpress-seo"),...t):""}({days:n,hours:i,minutes:a});return(0,t.createElement)("div",{className:m},o&&"string"==typeof g&&g.length>0&&(0,t.createElement)("p",{className:"schema-how-to-total-time"},(0,t.createElement)("span",{className:"schema-how-to-duration-time-text"},u||d," "),g+". "),(0,t.createElement)(y,{tagName:"p",className:"schema-how-to-description",value:r}),p?(0,t.createElement)("ul",{className:w},x.getStepsContent(s)):(0,t.createElement)("ol",{className:w},x.getStepsContent(s)))}getAddStepButton(){return(0,t.createElement)(w.Button,{icon:"insert",onClick:this.onAddStepButtonClick,className:"schema-how-to-add-step"},(0,h.__)("Add step","wordpress-seo"))}addCSSClasses(e){this.props.setAttributes({additionalListCssClasses:e})}toggleListType(e){this.props.setAttributes({unorderedList:e})}getListTypeHelp(e){return e?(0,h.__)("Showing step items as an unordered list","wordpress-seo"):(0,h.__)("Showing step items as an ordered list.","wordpress-seo")}focusDescription(){this.setFocus("description")}onChangeDescription(e){this.props.setAttributes({description:e,jsonDescription:(0,u.renderToString)(e)})}addDuration(){this.props.setAttributes({hasDuration:!0}),setTimeout((()=>this.daysInput.current.focus()))}removeDuration(){this.props.setAttributes({hasDuration:!1}),setTimeout((()=>{this.addDurationButton.current instanceof u.Component||this.addDurationButton.current.focus()}))}onChangeDays(e){const t=this.formatDuration(e.target.value);this.props.setAttributes({days:(0,l.toString)(t)})}onChangeHours(e){const t=this.formatDuration(e.target.value,23);this.props.setAttributes({hours:(0,l.toString)(t)})}onChangeMinutes(e){const t=this.formatDuration(e.target.value,59);this.props.setAttributes({minutes:(0,l.toString)(t)})}getDuration(){const{attributes:e}=this.props;return e.hasDuration?(0,t.createElement)("fieldset",{className:"schema-how-to-duration"},(0,t.createElement)("span",{className:"schema-how-to-duration-flex-container",role:"presentation"},(0,t.createElement)("legend",{className:"schema-how-to-duration-legend"},e.durationText||this.getDefaultDurationText()),(0,t.createElement)("span",{className:"schema-how-to-duration-time-input"},(0,t.createElement)("label",{htmlFor:"schema-how-to-duration-days",className:"screen-reader-text"},/* translators: Hidden accessibility text. */
|
||||
(0,h.__)("days","wordpress-seo")),(0,t.createElement)("input",{id:"schema-how-to-duration-days",className:"schema-how-to-duration-input",type:"number",value:e.days,onChange:this.onChangeDays,placeholder:"DD",ref:this.daysInput}),(0,t.createElement)("label",{htmlFor:"schema-how-to-duration-hours",className:"screen-reader-text"},(0,h.__)("hours","wordpress-seo")),(0,t.createElement)("input",{id:"schema-how-to-duration-hours",className:"schema-how-to-duration-input",type:"number",value:e.hours,onChange:this.onChangeHours,placeholder:"HH"}),(0,t.createElement)("span",{"aria-hidden":"true"},":"),(0,t.createElement)("label",{htmlFor:"schema-how-to-duration-minutes",className:"screen-reader-text"},(0,h.__)("minutes","wordpress-seo")),(0,t.createElement)("input",{id:"schema-how-to-duration-minutes",className:"schema-how-to-duration-input",type:"number",value:e.minutes,onChange:this.onChangeMinutes,placeholder:"MM"}),(0,t.createElement)(w.Button,{className:"schema-how-to-duration-delete-button",icon:"trash",label:(0,h.__)("Delete total time","wordpress-seo"),onClick:this.removeDuration})))):(0,t.createElement)(w.Button,{onClick:this.addDuration,className:"schema-how-to-duration-button",ref:this.addDurationButton,icon:"insert"},(0,h.__)("Add total time","wordpress-seo"))}getSidebar(e,o,n){return n===this.getDefaultDurationText()&&(n=""),(0,t.createElement)(s.InspectorControls,null,(0,t.createElement)(w.PanelBody,{title:(0,h.__)("Settings","wordpress-seo"),className:"blocks-font-size"},(0,t.createElement)(f,{label:(0,h.__)("CSS class(es) to apply to the steps","wordpress-seo"),value:o,onChange:this.addCSSClasses,help:(0,h.__)("Optional. This can give you better control over the styling of the steps.","wordpress-seo")}),(0,t.createElement)(f,{label:(0,h.__)("Describe the duration of the instruction:","wordpress-seo"),value:n,onChange:this.setDurationText,help:(0,h.__)("Optional. Customize how you want to describe the duration of the instruction","wordpress-seo"),placeholder:this.getDefaultDurationText()}),(0,t.createElement)(w.ToggleControl,{label:(0,h.__)("Unordered list","wordpress-seo"),checked:e||!1,onChange:this.toggleListType,help:this.getListTypeHelp})))}render(){const{attributes:e,className:o}=this.props,n=["schema-how-to",o].filter((e=>e)).join(" "),i=["schema-how-to-steps",e.additionalListCssClasses].filter((e=>e)).join(" ");return(0,t.createElement)("div",{className:n},this.getDuration(),(0,t.createElement)(s.RichText,{identifier:"description",tagName:"p",className:"schema-how-to-description",value:e.description,onChange:this.onChangeDescription,onFocus:this.focusDescription,unstableOnFocus:this.focusDescription,placeholder:(0,h.__)("Enter a description","wordpress-seo")}),(0,t.createElement)("ul",{className:i},this.getSteps()),(0,t.createElement)("div",{className:"schema-how-to-buttons"},this.getAddStepButton()),this.getSidebar(e.unorderedList,e.additionalListCssClasses,e.durationText))}}function C(e,t=0){return parseInt(e,10)||t}function v(e){const t=function({days:e,hours:t,minutes:s}){const o=[];return 0!==e&&o.push((0,h.sprintf)((0,h._n)("%d day","%d days",e,"wordpress-seo"),e)),0!==t&&o.push((0,h.sprintf)((0,h._n)("%d hour","%d hours",t,"wordpress-seo"),t)),0!==s&&o.push((0,h.sprintf)((0,h._n)("%d minute","%d minutes",s,"wordpress-seo"),s)),o}({days:C(e.days),hours:C(e.hours),minutes:C(e.minutes)});return 1===t.length?t[0]:2===t.length?(0,h.sprintf)(/* translators: %s expands to a unit of time (e.g. 1 day). */
|
||||
(0,h.__)("%s and %s","wordpress-seo"),...t):3===t.length?(0,h.sprintf)(/* translators: %s expands to a unit of time (e.g. 1 day). */
|
||||
(0,h.__)("%s, %s and %s","wordpress-seo"),...t):""}x.propTypes={attributes:a().object.isRequired,setAttributes:a().func.isRequired,className:a().string},x.defaultProps={className:""};const D=e=>(0,t.createElement)("li",{className:"schema-how-to-step",key:e.id},(0,t.createElement)("strong",{className:"schema-how-to-step-name",key:e.id+"-name"},e.name)," ",(0,t.createElement)("p",{className:"schema-how-to-step-text",key:e.id+"-text"},e.text)," ");function E(e){let{steps:s}=e.attributes;const{hasDuration:o,days:n,hours:i,minutes:a,description:r,unorderedList:p,additionalListCssClasses:c,className:l}=e.attributes;s=s?s.map((e=>(0,t.createElement)(D,{...e,key:e.id}))):null;const u=["schema-how-to",l].filter((e=>e)).join(" "),d=["schema-how-to-steps",c].filter((e=>e)).join(" "),m=v({days:n,hours:i,minutes:a});return(0,t.createElement)("div",{className:u},o&&"string"==typeof m&&m.length>0&&(0,t.createElement)("p",{className:"schema-how-to-total-time"},(0,h.__)("Time needed:","wordpress-seo")," ",m+". "),(0,t.createElement)("p",{className:"schema-how-to-description"},r)," ",p?(0,t.createElement)("ul",{className:d},s):(0,t.createElement)("ol",{className:d},s))}function T(e){return(0,t.createElement)("li",{className:"schema-how-to-step",key:e.id},(0,t.createElement)("strong",{className:"schema-how-to-step-name",key:e.id+"-name"},e.name)," ",(0,t.createElement)("p",{className:"schema-how-to-step-text",key:e.id+"-text"},e.text)," ")}function _(e){const{steps:s,hasDuration:o,days:n,hours:i,minutes:a,description:r,unorderedList:p,additionalListCssClasses:h,className:c,durationText:l,defaultDurationText:u}=e.attributes,d=["schema-how-to",c].filter((e=>e)).join(" "),m=["schema-how-to-steps",h].filter((e=>e)).join(" "),w=v({days:n,hours:i,minutes:a});let g=[];return s&&(g=s.map((e=>(0,t.createElement)(T,{...e,key:e.id})))),(0,t.createElement)("div",{className:d},o&&"string"==typeof w&&w.length>0&&(0,t.createElement)("p",{className:"schema-how-to-total-time"},(0,t.createElement)("span",{className:"schema-how-to-duration-time-text"},l||u," "),w+". "),(0,t.createElement)("p",{className:"schema-how-to-description"},r)," ",p?(0,t.createElement)("ul",{className:m},g):(0,t.createElement)("ol",{className:m},g))}E.propTypes={attributes:a().object},_.propTypes={attributes:a().object.isRequired};const N={v8_2:E,v11_4:_};(0,o.registerBlockType)(n,{edit:({attributes:e,setAttributes:o,className:n})=>{const i=(0,s.useBlockProps)();return e.steps&&0!==e.steps.length||(e.steps=[{id:x.generateId("how-to-step"),name:[],text:[]}]),(0,t.createElement)("div",{...i},(0,t.createElement)(x,{attributes:e,setAttributes:o,className:n}))},save:({attributes:e})=>(0,t.createElement)(x.Content,{...e}),deprecated:[{attributes:n.attributes,save:N.v11_4},{attributes:n.attributes,save:N.v8_2}]})})();
|
||||
(0,h.__)("%s, %s and %s","wordpress-seo"),...t):""}x.propTypes={attributes:a().object.isRequired,setAttributes:a().func.isRequired,className:a().string},x.defaultProps={className:""};const D=e=>(0,t.createElement)("li",{className:"schema-how-to-step",key:e.id},(0,t.createElement)("strong",{className:"schema-how-to-step-name",key:e.id+"-name"},e.name)," ",(0,t.createElement)("p",{className:"schema-how-to-step-text",key:e.id+"-text"},e.text)," ");function E(e){let{steps:s}=e.attributes;const{hasDuration:o,days:n,hours:i,minutes:a,description:r,unorderedList:p,additionalListCssClasses:c,className:l}=e.attributes;s=s?s.map((e=>(0,t.createElement)(D,{...e,key:e.id}))):null;const u=["schema-how-to",l].filter((e=>e)).join(" "),d=["schema-how-to-steps",c].filter((e=>e)).join(" "),m=v({days:n,hours:i,minutes:a});return(0,t.createElement)("div",{className:u},o&&"string"==typeof m&&m.length>0&&(0,t.createElement)("p",{className:"schema-how-to-total-time"},(0,h.__)("Time needed:","wordpress-seo")," ",m+". "),(0,t.createElement)("p",{className:"schema-how-to-description"},r)," ",p?(0,t.createElement)("ul",{className:d},s):(0,t.createElement)("ol",{className:d},s))}function T(e){return(0,t.createElement)("li",{className:"schema-how-to-step",key:e.id},(0,t.createElement)("strong",{className:"schema-how-to-step-name",key:e.id+"-name"},e.name)," ",(0,t.createElement)("p",{className:"schema-how-to-step-text",key:e.id+"-text"},e.text)," ")}function _(e){const{steps:s,hasDuration:o,days:n,hours:i,minutes:a,description:r,unorderedList:p,additionalListCssClasses:h,className:c,durationText:l,defaultDurationText:u}=e.attributes,d=["schema-how-to",c].filter((e=>e)).join(" "),m=["schema-how-to-steps",h].filter((e=>e)).join(" "),w=v({days:n,hours:i,minutes:a});let g=[];return s&&(g=s.map((e=>(0,t.createElement)(T,{...e,key:e.id})))),(0,t.createElement)("div",{className:d},o&&"string"==typeof w&&w.length>0&&(0,t.createElement)("p",{className:"schema-how-to-total-time"},(0,t.createElement)("span",{className:"schema-how-to-duration-time-text"},l||u," "),w+". "),(0,t.createElement)("p",{className:"schema-how-to-description"},r)," ",p?(0,t.createElement)("ul",{className:m},g):(0,t.createElement)("ol",{className:m},g))}E.propTypes={attributes:a().object},_.propTypes={attributes:a().object.isRequired};const N={v8_2:E,v11_4:_};(0,o.registerBlockType)(n,{edit:({attributes:e,setAttributes:o,className:n})=>{const i=(0,s.useBlockProps)();return e.steps&&0!==e.steps.length||(e.steps=[{id:x.generateId("how-to-step"),name:[],text:[]}]),(0,t.createElement)("div",{...i},(0,t.createElement)(x,{attributes:e,setAttributes:o,className:n}))},save:({attributes:e})=>{const o=s.useBlockProps.save(e);return(0,t.createElement)(x.Content,{...o})},deprecated:[{attributes:n.attributes,save:N.v11_4},{attributes:n.attributes,save:N.v8_2}]})})();
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@ License: GPLv3
|
||||
License URI: http://www.gnu.org/licenses/gpl.html
|
||||
Tags: SEO, XML sitemap, Content analysis, Readability, Schema
|
||||
Tested up to: 6.5
|
||||
Stable tag: 22.7
|
||||
Stable tag: 22.8
|
||||
Requires PHP: 7.2.5
|
||||
|
||||
Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the Yoast SEO plugin.
|
||||
@@ -315,6 +315,30 @@ Your question has most likely been answered on our help center: [yoast.com/help/
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 22.8 =
|
||||
|
||||
Release date: 2024-05-28
|
||||
|
||||
Yoast SEO 22.8 brings enhancements and bugfixes. [Find more information about our software releases and updates here](https://yoa.st/release-28-5-24).
|
||||
|
||||
#### Enhancements
|
||||
|
||||
* Converts the Yoast _Breadcrumbs_ block to use the Blocks V3 API.
|
||||
|
||||
#### Bugfixes
|
||||
|
||||
* Fixes a bug preventing multiple _FAQ_ blocks from being added to a post/page.
|
||||
* Fixes a bug where a class was missing in the output of the _FAQ_ and _How-To_ blocks.
|
||||
* Fixes a bug where a "Failed to retrieve media" error could prevent selecting a different image or removing the current selection.
|
||||
* Fixes a bug where our modals would not open when visiting our sidebar in Elementor for the second time.
|
||||
* Fixes a bug where some Yoast SEO settings could not be imported correctly.
|
||||
|
||||
#### Other
|
||||
|
||||
* Removes the fixed date and separator snippet variables from the meta description text field.
|
||||
* Removes the Yoast SEO Breadcrumbs panel from the Customizer to improve compatibility with block-based themes. Users can always change the options for the breadcrumbs under Yoast SEO > Settings > Advanced > Breadcrumbs.
|
||||
* Deprecates the `WPSEO_Customizer` class.
|
||||
|
||||
= 22.7 =
|
||||
|
||||
Release date: 2024-05-14
|
||||
@@ -339,28 +363,5 @@ Yoast SEO 22.7 converts selected blocks to the Blocks V3 API and brings multiple
|
||||
* Removes the `yoast-components-package` script.
|
||||
* Sets the minimum supported WordPress version to 6.4.
|
||||
|
||||
= 22.6 =
|
||||
|
||||
Release date: 2024-04-30
|
||||
|
||||
Yoast SEO 22.6 is out today! This release brings many performance and quality-of-life fixes to improve your favorite SEO plugin. Plus, we’re asking you to update your PHP versions. Find out what’s new in [this post](https://yoa.st/release-30-4-24)!
|
||||
|
||||
#### Enhancements
|
||||
|
||||
* Adds a helpful error message in the Yoast sidebar/metabox in case of plugin or theme conflicts. Now when an unknown error occurs, the error is caught and an error message is shown. Before, the error would lead to a blank sidebar/metabox, or to an entire blank page.
|
||||
* Improves performance when it comes to storing user metadata, most visible at the point of author sitemap creation.
|
||||
* Improves the keyphrase detection in SEO title for Arabic and Hebrew. For example, when the keyphrase is \"باندا حمراء\" and the SEO title starts with \"الباندا الحمراء\", we now recognize this as an exact match and give a good result for the _keyphrase in SEO title_ assessment.
|
||||
|
||||
#### Bugfixes
|
||||
|
||||
* Fixes a bug where a PHP notice in the settings would influence the styling of some of our inputs.
|
||||
* Fixes a bug where the inserted variables in the search appearance would not show correctly when using Elementor.
|
||||
* Fixes a bug where there would be a fatal error when deleting post meta in PHP 8.1 and higher. Props to @izzygld.
|
||||
* Fixes a security issue where URLs were not correctly escaped in the Yoast admin bar menu.
|
||||
|
||||
#### Other
|
||||
|
||||
* Introduces a notice on the WordPress dashboard and the Yoast SEO dashboard to let users know we are dropping support for PHP < 7.4 starting November 1st, 2024.
|
||||
|
||||
= Earlier versions =
|
||||
For the changelog of earlier versions, please refer to [the changelog on yoast.com](https://yoa.st/yoast-seo-changelog).
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Customizer
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class with functionality to support WP SEO settings in WordPress Customizer.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 22.8
|
||||
*/
|
||||
class WPSEO_Customizer {
|
||||
|
||||
/**
|
||||
* Holds the customize manager.
|
||||
*
|
||||
* @deprecated 22.8
|
||||
*
|
||||
* @var WP_Customize_Manager
|
||||
*/
|
||||
protected $wp_customize;
|
||||
|
||||
/**
|
||||
* Construct Method.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 22.8
|
||||
*/
|
||||
public function __construct() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 22.8' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to support WordPress Customizer.
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Manager class instance.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 22.8
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function wpseo_customize_register( $wp_customize ) {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 22.8' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the breadcrumbs are active.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 22.8
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function breadcrumbs_active_callback() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 22.8' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not to show the breadcrumbs blog show option.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 22.8
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function breadcrumbs_blog_show_active_cb() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 22.8' );
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class WPSEO_HelpScout
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 20.3
|
||||
*/
|
||||
class WPSEO_HelpScout implements WPSEO_WordPress_Integration {
|
||||
|
||||
/**
|
||||
* WPSEO_HelpScout constructor.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 20.3
|
||||
*
|
||||
* @param string $beacon_id The beacon id.
|
||||
* @param array $pages The pages where the beacon is loaded.
|
||||
* @param array $products The products the beacon is loaded for.
|
||||
* @param bool $ask_consent Optional. Whether to ask for consent before loading in HelpScout.
|
||||
*/
|
||||
public function __construct( $beacon_id, array $pages, array $products, $ask_consent = false ) {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 20.3
|
||||
*/
|
||||
public function register_hooks() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3', 'HelpScout_Beacon::register_hooks' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueues the HelpScout script.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 20.3
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function enqueue_help_scout_script() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3', 'HelpScout_Beacon::enqueue_help_scout_script' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs a small piece of javascript for the beacon.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated 20.3
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function output_beacon_js() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3', 'HelpScout_Beacon::output_beacon_js' );
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Views
|
||||
*/
|
||||
|
||||
use Yoast\WP\SEO\Presenters\Admin\Alert_Presenter;
|
||||
|
||||
/**
|
||||
* Class Yoast_View_Utils.
|
||||
*
|
||||
* @deprecated 20.3
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Yoast_View_Utils {
|
||||
|
||||
/**
|
||||
* Form to use.
|
||||
*
|
||||
* @var Yoast_Form
|
||||
*/
|
||||
protected $form;
|
||||
|
||||
/**
|
||||
* Yoast_View_Utils constructor.
|
||||
*
|
||||
* @deprecated 20.3
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function __construct() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
|
||||
$this->form = Yoast_Form::get_instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the search results help question mark and help section.
|
||||
*
|
||||
* Used for all the Help sections for indexable objects like post types, taxonomies, or archives.
|
||||
*
|
||||
* @deprecated 20.3
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string|object $post_type The post type to show the search results help for.
|
||||
* @param string $help_text_switch Switch the help text to one that's more appropriate
|
||||
* for the indexable object type the help section is for.
|
||||
* @return object The help panel instance.
|
||||
*/
|
||||
public function search_results_setting_help( $post_type, $help_text_switch = '' ) {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
|
||||
if ( ! is_object( $post_type ) ) {
|
||||
$post_type = get_post_type_object( $post_type );
|
||||
}
|
||||
|
||||
/* translators: 1: expands to an indexable object's name, like a post type or taxonomy; 2: expands to <code>noindex</code>; 3: link open tag; 4: link close tag. */
|
||||
$help_text = esc_html__( 'Not showing %1$s in the search results technically means those will have a %2$s robots meta and will be excluded from XML sitemaps. %3$sMore info on the search results settings%4$s.', 'wordpress-seo' );
|
||||
|
||||
if ( $help_text_switch === 'archive' ) {
|
||||
/* translators: 1: expands to an indexable object's name, like a post type or taxonomy; 2: expands to <code>noindex</code>; 3: link open tag; 4: link close tag. */
|
||||
$help_text = esc_html__( 'Not showing the archive for %1$s in the search results technically means those will have a %2$s robots meta and will be excluded from XML sitemaps. %3$sMore info on the search results settings%4$s.', 'wordpress-seo' );
|
||||
}
|
||||
|
||||
$help_panel = new WPSEO_Admin_Help_Panel(
|
||||
// Sometimes the same post type is used more than once in the same page, we need a unique ID though.
|
||||
uniqid( 'noindex-' . $post_type->name ),
|
||||
esc_html__( 'Help on this search results setting', 'wordpress-seo' ),
|
||||
sprintf(
|
||||
$help_text,
|
||||
$post_type->labels->name,
|
||||
'<code>noindex</code>',
|
||||
'<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/show-x' ) ) . '" target="_blank" rel="noopener noreferrer">',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
|
||||
return $help_panel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the OpenGraph disabled alert, depending on whether the OpenGraph feature is disabled.
|
||||
*
|
||||
* @deprecated 20.3
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $type The type of message. Can be altered to homepage, taxonomies or archives. Empty string by default.
|
||||
*
|
||||
* @return string The alert. Returns an empty string if the setting is enabled.
|
||||
*/
|
||||
public function generate_opengraph_disabled_alert( $type = '' ) {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
|
||||
$is_enabled = WPSEO_Options::get( 'opengraph', true );
|
||||
|
||||
if ( $is_enabled ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$message = $this->generate_opengraph_disabled_alert_text( $type );
|
||||
|
||||
if ( empty( $message ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$alert = new Alert_Presenter( $message, 'info' );
|
||||
|
||||
return sprintf(
|
||||
'<div class="yoast-measure padded">%s</div>',
|
||||
$alert->present()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the OpenGraph disabled alert text.
|
||||
*
|
||||
* @param string $type The type of message. Can be altered to homepage, taxonomies or archives. Empty string by default.
|
||||
*
|
||||
* @return string The alert. Returns an empty string if the setting is enabled.
|
||||
*/
|
||||
private function generate_opengraph_disabled_alert_text( $type ) {
|
||||
if ( $type === 'homepage' ) {
|
||||
return sprintf(
|
||||
/* translators: 1: link open tag; 2: link close tag. */
|
||||
esc_html__(
|
||||
'The social appearance settings for your homepage require Open Graph metadata (which is currently disabled). You can enable this in the %1$s‘Social’ settings under the ‘Facebook’ tab%2$s.',
|
||||
'wordpress-seo'
|
||||
),
|
||||
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! YoastSEO()->helpers->product->is_premium() ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( $type === '' ) {
|
||||
return sprintf(
|
||||
/* translators: 1: link open tag; 2: link close tag. */
|
||||
esc_html__(
|
||||
'The social appearance settings for content types require Open Graph metadata (which is currently disabled). You can enable this in the %1$s‘Social’ settings under the ‘Facebook’ tab%2$s.',
|
||||
'wordpress-seo'
|
||||
),
|
||||
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
|
||||
if ( $type === 'taxonomies' ) {
|
||||
return sprintf(
|
||||
/* translators: 1: link open tag; 2: link close tag. */
|
||||
esc_html__(
|
||||
'The social appearance settings for taxonomies require Open Graph metadata (which is currently disabled). You can enable this in the %1$s‘Social’ settings under the ‘Facebook’ tab%2$s.',
|
||||
'wordpress-seo'
|
||||
),
|
||||
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
|
||||
if ( $type === 'archives' ) {
|
||||
return sprintf(
|
||||
/* translators: 1: link open tag; 2: link close tag. */
|
||||
esc_html__(
|
||||
'The social appearance settings for archives require Open Graph metadata (which is currently disabled). You can enable this in the %1$s‘Social’ settings under the ‘Facebook’ tab%2$s.',
|
||||
'wordpress-seo'
|
||||
),
|
||||
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
-451
@@ -1,451 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Actions;
|
||||
|
||||
use Yoast\WP\SEO\Helpers\Indexables_Page_Helper;
|
||||
use Yoast\WP\SEO\Helpers\Options_Helper;
|
||||
use Yoast\WP\SEO\Helpers\Post_Type_Helper;
|
||||
use Yoast\WP\SEO\Repositories\Indexable_Repository;
|
||||
|
||||
/**
|
||||
* Get action for indexables.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Indexables_Page_Action {
|
||||
|
||||
/**
|
||||
* The indexable repository.
|
||||
*
|
||||
* @var Indexable_Repository
|
||||
*/
|
||||
private $indexable_repository;
|
||||
|
||||
/**
|
||||
* The post type helper.
|
||||
*
|
||||
* @var Post_Type_Helper
|
||||
*/
|
||||
private $post_type_helper;
|
||||
|
||||
/**
|
||||
* The options helper.
|
||||
*
|
||||
* @var Options_Helper
|
||||
*/
|
||||
private $options_helper;
|
||||
|
||||
/**
|
||||
* The indexables page helper.
|
||||
*
|
||||
* @var Indexables_Page_Helper
|
||||
*/
|
||||
private $indexables_page_helper;
|
||||
|
||||
/**
|
||||
* Indexable_Action constructor.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param Indexable_Repository $indexable_repository The indexable repository.
|
||||
* @param Post_Type_Helper $post_type_helper The post type helper.
|
||||
* @param Options_Helper $options_helper The options helper.
|
||||
* @param Indexables_Page_Helper $indexables_page_helper The indexables page helper.
|
||||
*/
|
||||
public function __construct(
|
||||
Indexable_Repository $indexable_repository,
|
||||
Post_Type_Helper $post_type_helper,
|
||||
Options_Helper $options_helper,
|
||||
Indexables_Page_Helper $indexables_page_helper
|
||||
) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
$this->indexable_repository = $indexable_repository;
|
||||
$this->post_type_helper = $post_type_helper;
|
||||
$this->options_helper = $options_helper;
|
||||
$this->indexables_page_helper = $indexables_page_helper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get public sub types that are relevant for the indexable page.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array The subtypes.
|
||||
*/
|
||||
protected function get_sub_types() {
|
||||
$object_sub_types = \array_values( $this->post_type_helper->get_public_post_types() );
|
||||
|
||||
$excluded_post_types = \apply_filters( 'wpseo_indexable_excluded_post_types', [ 'attachment' ] );
|
||||
|
||||
/**
|
||||
* Filter: 'wpseo_indexable_included_post_types' - Allow developers to specify which post types will
|
||||
* be shown in the indexables overview cards.
|
||||
*
|
||||
* @param array $included_post_types The currently included post types.
|
||||
*/
|
||||
$included_post_types = \apply_filters_deprecated( 'wpseo_indexable_included_post_types', [ [ 'post', 'page' ] ], 'Yoast SEO 20.4' );
|
||||
$object_sub_types = \array_diff( $object_sub_types, $excluded_post_types );
|
||||
$only_post_pages = \array_intersect( $object_sub_types, $included_post_types );
|
||||
|
||||
$wanted_sub_types = [];
|
||||
foreach ( $only_post_pages as $sub_type ) {
|
||||
if ( $this->post_type_helper->has_metabox( $sub_type ) ) {
|
||||
$wanted_sub_types[] = $sub_type;
|
||||
}
|
||||
}
|
||||
return $wanted_sub_types;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a query that can find public indexables.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return ORM Returns an ORM instance that can be used to execute the query.
|
||||
*/
|
||||
protected function query() {
|
||||
$sub_types = $this->get_sub_types();
|
||||
if ( empty( $sub_types ) ) {
|
||||
// If there are no subtypes to display, any query should return an empty result.
|
||||
return $this->indexable_repository->query()->where_raw( '1 = 0' );
|
||||
}
|
||||
|
||||
// Make sure that we consider the noindex of both each post but also for the global values.
|
||||
$build_where = '(';
|
||||
foreach ( $sub_types as $sub_type ) {
|
||||
$is_default_noindex = $this->post_type_helper->is_indexable( $sub_type ) ? ' OR is_robots_noindex IS NULL' : '';
|
||||
$build_where .= '( object_sub_type = \'' . $sub_type . '\' AND ( is_robots_noindex = FALSE' . $is_default_noindex . ' ) ) OR';
|
||||
}
|
||||
$build_where = \rtrim( $build_where, ' OR' );
|
||||
$build_where .= ')';
|
||||
|
||||
return $this->indexable_repository->query()
|
||||
->where_raw( '( post_status = \'publish\' OR post_status IS NULL )' )
|
||||
->where_in( 'object_type', [ 'post' ] )
|
||||
->where_raw( $build_where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the neccessary information to set up the indexables page.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param int $content_threshold The threshold to check against for enough content.
|
||||
* @param int $analysis_threshold The threshold to check against for enough analyzed content.
|
||||
*
|
||||
* @return array The neccessary information to set up the indexables page.
|
||||
*/
|
||||
public function get_setup_info( $content_threshold, $analysis_threshold ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
$features = [
|
||||
'isSeoScoreEnabled' => $this->options_helper->get( 'keyword_analysis_active', true ),
|
||||
'isReadabilityEnabled' => $this->options_helper->get( 'content_analysis_active', true ),
|
||||
'isLinkCountEnabled' => $this->options_helper->get( 'enable_text_link_counter', true ),
|
||||
];
|
||||
|
||||
$posts_with_seo_score = 0;
|
||||
$posts_with_readability = 0;
|
||||
$posts_without_keyphrase = [];
|
||||
|
||||
$all_posts = $this->query()->count();
|
||||
|
||||
if ( $all_posts < 1 ) {
|
||||
$this->set_indexables_state( 'no-content' );
|
||||
return [
|
||||
'enabledFeatures' => $features,
|
||||
'enoughContent' => false,
|
||||
'enoughAnalysedContent' => false,
|
||||
];
|
||||
}
|
||||
|
||||
$posts_with_seo_score = $this->query()
|
||||
->where_not_equal( 'primary_focus_keyword', 0 )
|
||||
->count();
|
||||
|
||||
$posts_without_keyphrase = $this->query()
|
||||
->where_null( 'primary_focus_keyword' )
|
||||
->order_by_desc( 'incoming_link_count' )
|
||||
->find_many();
|
||||
|
||||
$posts_with_readability = $this->query()
|
||||
->where_not_equal( 'readability_score', 0 )
|
||||
->count();
|
||||
|
||||
$analysed_content = ( \max( $posts_with_seo_score, $posts_with_readability ) / $all_posts );
|
||||
|
||||
$enough_content = $all_posts > $content_threshold;
|
||||
$enough_analysed_content = $analysed_content > $analysis_threshold;
|
||||
|
||||
if ( ! $enough_content ) {
|
||||
$this->set_indexables_state( 'not-enough-content' );
|
||||
}
|
||||
elseif ( ! $enough_analysed_content ) {
|
||||
$this->set_indexables_state( 'not-enough-analysed-content' );
|
||||
}
|
||||
else {
|
||||
$this->set_indexables_state( 'lists-shown' );
|
||||
}
|
||||
|
||||
return [
|
||||
'enabledFeatures' => $features,
|
||||
'enoughContent' => $enough_content,
|
||||
'enoughAnalysedContent' => $enough_analysed_content,
|
||||
'postsWithoutKeyphrase' => \array_map(
|
||||
static function ( $indexable ) {
|
||||
$output = $indexable;
|
||||
if ( $indexable->incoming_link_count === null ) {
|
||||
$output->incoming_link_count = 0;
|
||||
}
|
||||
return $output;
|
||||
},
|
||||
$posts_without_keyphrase
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the posts with the smallest readability scores.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param int $limit The maximum amount of results to return.
|
||||
*
|
||||
* @return array The posts with the smallest readability scores as an array.
|
||||
*/
|
||||
public function get_least_readable( $limit ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
$least_readability_ignore_list = $this->options_helper->get( 'least_readability_ignore_list', [] );
|
||||
$ignore_list = empty( $least_readability_ignore_list ) ? [ -1 ] : $least_readability_ignore_list;
|
||||
|
||||
$least_readable = $this->query()
|
||||
->select_many( 'id', 'object_id', 'object_sub_type', 'permalink', 'breadcrumb_title', 'readability_score' )
|
||||
->where_not_in( 'id', $ignore_list )
|
||||
->where_not_equal( 'readability_score', 0 )
|
||||
->order_by_asc( 'readability_score' )
|
||||
->limit( $limit )
|
||||
->find_many();
|
||||
|
||||
return \array_map( [ $this->indexable_repository, 'ensure_permalink' ], $least_readable );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the posts with the lowest seo scores.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param int $limit The maximum amount of results to return.
|
||||
*
|
||||
* @return array The posts with the lowest seo scores as an array.
|
||||
*/
|
||||
public function get_least_seo_score( $limit ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
// Where_not_equal needs the set to check against not to be empty.
|
||||
$least_seo_score_ignore_list = $this->options_helper->get( 'least_seo_score_ignore_list', [] );
|
||||
$ignore_list = empty( $least_seo_score_ignore_list ) ? [ -1 ] : $least_seo_score_ignore_list;
|
||||
|
||||
$least_seo_score = $this->query()
|
||||
->select_many( 'id', 'object_id', 'object_sub_type', 'permalink', 'breadcrumb_title', 'primary_focus_keyword', 'primary_focus_keyword_score' )
|
||||
->where_not_in( 'id', $ignore_list )
|
||||
->where_not_equal( 'primary_focus_keyword', 0 )
|
||||
->order_by_asc( 'primary_focus_keyword_score' )
|
||||
->limit( $limit )
|
||||
->find_many();
|
||||
|
||||
return \array_map( [ $this->indexable_repository, 'ensure_permalink' ], $least_seo_score );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the most linked posts.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param int $limit The maximum amount of results to return.
|
||||
*
|
||||
* @return array The most linked posts as an array.
|
||||
*/
|
||||
public function get_most_linked( $limit ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
// Where_not_equal needs the set to check against not to be empty.
|
||||
$most_linked_ignore_list = $this->options_helper->get( 'most_linked_ignore_list', [] );
|
||||
$ignore_list = empty( $most_linked_ignore_list ) ? [ -1 ] : $most_linked_ignore_list;
|
||||
|
||||
$most_linked = $this->query()
|
||||
->select_many( 'id', 'object_id', 'object_sub_type', 'permalink', 'breadcrumb_title', 'incoming_link_count', 'is_cornerstone' )
|
||||
->where_gt( 'incoming_link_count', 0 )
|
||||
->where_not_null( 'incoming_link_count' )
|
||||
->where_not_in( 'id', $ignore_list )
|
||||
->order_by_desc( 'incoming_link_count' )
|
||||
->limit( $limit )
|
||||
->find_many();
|
||||
|
||||
return \array_map( [ $this->indexable_repository, 'ensure_permalink' ], $most_linked );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the least linked posts.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param int $limit The maximum amount of results to return.
|
||||
*
|
||||
* @return array The most linked posts as an array.
|
||||
*/
|
||||
public function get_least_linked( $limit ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
// Where_not_equal needs the set to check against not to be empty.
|
||||
$least_linked_ignore_list = $this->options_helper->get( 'least_linked_ignore_list', [] );
|
||||
$ignore_list = empty( $least_linked_ignore_list ) ? [ -1 ] : $least_linked_ignore_list;
|
||||
|
||||
$least_linked = $this->query()
|
||||
->select_many( 'id', 'object_id', 'object_sub_type', 'permalink', 'breadcrumb_title', 'incoming_link_count' )
|
||||
->where_not_in( 'id', $ignore_list )
|
||||
->order_by_asc( 'incoming_link_count' )
|
||||
->limit( $limit )
|
||||
->find_many();
|
||||
|
||||
$least_linked = \array_map( [ $this->indexable_repository, 'ensure_permalink' ], $least_linked );
|
||||
return \array_map(
|
||||
static function ( $indexable ) {
|
||||
$output = $indexable;
|
||||
if ( $indexable->incoming_link_count === null ) {
|
||||
$output->incoming_link_count = 0;
|
||||
}
|
||||
return $output;
|
||||
},
|
||||
$least_linked
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores an indexable in an ignore-list.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $ignore_list_name The name of the ignore-list.
|
||||
* @param array $ignored_indexable_ids The IDs of the updated ignored indexables.
|
||||
*
|
||||
* @return bool Whether saving the ignore-list to the database succeeded.
|
||||
*/
|
||||
public function update_ignored_indexables( $ignore_list_name, $ignored_indexable_ids ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
if ( ! $this->indexables_page_helper->is_valid_ignore_list_name( $ignore_list_name ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->options_helper->set( $ignore_list_name, $ignored_indexable_ids );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an indexable from its ignore-list.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $ignore_list_name The name of the ignore-list.
|
||||
* @param int $indexable_id The ID of the indexable to store in the ignore-list.
|
||||
*
|
||||
* @return bool Whether saving the ignore-list to the database succeeded.
|
||||
*/
|
||||
public function remove_indexable_from_ignore_list( $ignore_list_name, $indexable_id ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
if ( ! $this->indexables_page_helper->is_valid_ignore_list_name( $ignore_list_name ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$ignore_list = $this->options_helper->get( $ignore_list_name, [] );
|
||||
|
||||
$ignore_list = \array_values(
|
||||
\array_filter(
|
||||
$ignore_list,
|
||||
static function ( $indexable ) use ( $indexable_id ) {
|
||||
return $indexable !== $indexable_id;
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
return $this->options_helper->set( $ignore_list_name, $ignore_list );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all indexables from an ignore-list.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $ignore_list_name The name of the ignore-list.
|
||||
*
|
||||
* @return bool Whether saving the ignore-list to the database succeeded.
|
||||
*/
|
||||
public function remove_all_indexables_from_ignore_list( $ignore_list_name ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
if ( ! $this->indexables_page_helper->is_valid_ignore_list_name( $ignore_list_name ) ) {
|
||||
return false;
|
||||
}
|
||||
return $this->options_helper->set( $ignore_list_name, [] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the reading list state.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array The state of each element in the reading list.
|
||||
*/
|
||||
public function get_reading_list() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
return $this->options_helper->get( 'indexables_page_reading_list', [ false, false, false, false, false ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the reading list state.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param array $state The state to be saved.
|
||||
*
|
||||
* @return bool Whether saving the reading list state succeeded.
|
||||
*/
|
||||
public function set_reading_list( $state ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
return $this->options_helper->set( 'indexables_page_reading_list', $state );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the indexables overview state.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $state The state to be saved.
|
||||
*
|
||||
* @return bool Whether saving the indexables overview state succeeded.
|
||||
*/
|
||||
public function set_indexables_state( $state ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
return $this->options_helper->set( 'indexables_overview_state', $state );
|
||||
}
|
||||
}
|
||||
-162
@@ -1,162 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Actions;
|
||||
|
||||
use Exception;
|
||||
use Yoast\WP\SEO\Helpers\User_Helper;
|
||||
|
||||
/**
|
||||
* Settings_Introduction_Action class.
|
||||
*
|
||||
* @deprecated 20.7
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Settings_Introduction_Action {
|
||||
|
||||
public const USER_META_KEY = '_yoast_settings_introduction';
|
||||
|
||||
public const DEFAULT_VALUES = [
|
||||
'wistia_embed_permission' => false,
|
||||
'show' => true,
|
||||
];
|
||||
|
||||
/**
|
||||
* Holds the User_Helper instance.
|
||||
*
|
||||
* @var User_Helper
|
||||
*/
|
||||
private $user_helper;
|
||||
|
||||
/**
|
||||
* Constructs Settings_Introduction_Action.
|
||||
*
|
||||
* @deprecated 20.7
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param User_Helper $user_helper The User_Helper.
|
||||
*/
|
||||
public function __construct( User_Helper $user_helper ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
|
||||
|
||||
$this->user_helper = $user_helper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the Wistia embed permission value.
|
||||
*
|
||||
* @deprecated 20.7
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return bool The value of the Wistia embed permission.
|
||||
*
|
||||
* @throws Exception If an invalid user ID is supplied.
|
||||
*/
|
||||
public function get_wistia_embed_permission() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
|
||||
|
||||
$user_id = $this->user_helper->get_current_user_id();
|
||||
$values = $this->get_values_for_user( $user_id );
|
||||
|
||||
return $values['wistia_embed_permission'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Wistia embed permission value.
|
||||
*
|
||||
* @deprecated 20.7
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param bool $value The value.
|
||||
*
|
||||
* @return bool Whether the update was successful.
|
||||
*
|
||||
* @throws Exception If an invalid user ID is supplied.
|
||||
*/
|
||||
public function set_wistia_embed_permission( $value ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
|
||||
|
||||
$user_id = $this->user_helper->get_current_user_id();
|
||||
$values = $this->get_values_for_user( $user_id );
|
||||
|
||||
// Check if there is anything to update.
|
||||
if ( $values['wistia_embed_permission'] === $value ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$values['wistia_embed_permission'] = $value;
|
||||
|
||||
return $this->user_helper->update_meta( $user_id, self::USER_META_KEY, $values ) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the show value.
|
||||
*
|
||||
* @deprecated 20.7
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return bool The value of show.
|
||||
*
|
||||
* @throws Exception If an invalid user ID is supplied.
|
||||
*/
|
||||
public function get_show() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
|
||||
|
||||
$user_id = $this->user_helper->get_current_user_id();
|
||||
$values = $this->get_values_for_user( $user_id );
|
||||
|
||||
return $values['show'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the show value.
|
||||
*
|
||||
* @deprecated 20.7
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param bool $value The value.
|
||||
*
|
||||
* @return bool Whether the update was successful.
|
||||
*
|
||||
* @throws Exception If an invalid user ID is supplied.
|
||||
*/
|
||||
public function set_show( $value ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
|
||||
|
||||
$user_id = $this->user_helper->get_current_user_id();
|
||||
$values = $this->get_values_for_user( $user_id );
|
||||
|
||||
// Check if there is anything to update.
|
||||
if ( $values['show'] === $value ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$values['show'] = $value;
|
||||
|
||||
return $this->user_helper->update_meta( $user_id, self::USER_META_KEY, $values ) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the (meta) values for a user.
|
||||
*
|
||||
* @param int $user_id User ID.
|
||||
*
|
||||
* @return array The (meta) values.
|
||||
*
|
||||
* @throws Exception If an invalid user ID is supplied.
|
||||
*/
|
||||
private function get_values_for_user( $user_id ) {
|
||||
$values = $this->user_helper->get_meta( $user_id, self::USER_META_KEY, true );
|
||||
if ( $values === false ) {
|
||||
throw new Exception( 'Invalid User ID' );
|
||||
}
|
||||
|
||||
if ( \is_array( $values ) && \array_key_exists( 'wistia_embed_permission', $values ) && \array_key_exists( 'show', $values ) ) {
|
||||
return $values;
|
||||
}
|
||||
|
||||
// Why could $values be invalid?
|
||||
// - When the database row does not exist yet, $values can be an empty string.
|
||||
// - Faulty data was stored?
|
||||
return self::DEFAULT_VALUES;
|
||||
}
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals;
|
||||
|
||||
/**
|
||||
* Feature flag conditional for the new indexables page.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Indexables_Page_Conditional extends Feature_Flag_Conditional {
|
||||
|
||||
/**
|
||||
* Returns the name of the feature flag.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return string The name of the feature flag.
|
||||
*/
|
||||
protected function get_feature_flag() {
|
||||
return 'INDEXABLES_PAGE';
|
||||
}
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals;
|
||||
|
||||
/**
|
||||
* Checks if the YOAST_SEO_SCHEMA_BLOCKS constant is set.
|
||||
*
|
||||
* @deprecated 20.5
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Schema_Blocks_Conditional extends Feature_Flag_Conditional {
|
||||
|
||||
/**
|
||||
* Returns the name of the feature flag.
|
||||
* 'YOAST_SEO_' is automatically prepended to it and it will be uppercased.
|
||||
*
|
||||
* @return string the name of the feature flag.
|
||||
*/
|
||||
protected function get_feature_flag() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
|
||||
return 'SCHEMA_BLOCKS';
|
||||
}
|
||||
}
|
||||
-215
@@ -1,215 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Helpers;
|
||||
|
||||
/**
|
||||
* A helper object for the indexable page.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Indexables_Page_Helper {
|
||||
|
||||
/**
|
||||
* The default size of the indexable lists.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public const LIST_SIZE = 5;
|
||||
|
||||
/**
|
||||
* The default size of the buffer, in terms of how many times is bigger than the list size.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public const BUFFER_SIZE = 20;
|
||||
|
||||
/**
|
||||
* The default minimum threshold for the amount of posts in the site.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public const POSTS_THRESHOLD = 20;
|
||||
|
||||
/**
|
||||
* The default minimum threshold for the amount of analysed posts in the site, as a fraction of the total posts.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public const ANALYSED_POSTS_THRESHOLD = 0.5;
|
||||
|
||||
/**
|
||||
* The options helper.
|
||||
*
|
||||
* @var Options_Helper
|
||||
*/
|
||||
private $options;
|
||||
|
||||
/**
|
||||
* Indexables_Page_Helper constructor.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param Options_Helper $options The options helper.
|
||||
*/
|
||||
public function __construct( Options_Helper $options ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the size of the Indexables lists. This size is the amount of indexables that are displayed in each list.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return int The size of the Indexables lists.
|
||||
*/
|
||||
public function get_indexables_list_size() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
/**
|
||||
* Filter 'wpseo_indexables_list_size' - Allow filtering the size of the Indexables lists.
|
||||
*
|
||||
* @param int $list_size The size of the Indexables lists.
|
||||
*/
|
||||
return \apply_filters_deprecated( 'wpseo_indexables_list_size', [ self::LIST_SIZE ], 'Yoast SEO 20.4' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the size of the buffer for the Indexables lists, in terms of how many times bigger it is from the lists' size. This size is the amount of indexables that are fetched upon page load.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return int The size of the Indexables lists.
|
||||
*/
|
||||
public function get_buffer_size() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
/**
|
||||
* Filter 'wpseo_indexables_buffer_size' - Allow filtering the size of the buffer for the Indexables lists, in terms of how many times bigger it is from the lists' size.
|
||||
*
|
||||
* @param int $buffer_size The size of the buffer for the Indexables lists, in terms of how many times bigger it is from the lists' size.
|
||||
*/
|
||||
$times = \apply_filters_deprecated( 'wpseo_indexables_buffer_size', [ self::BUFFER_SIZE ], 'Yoast SEO 20.4' );
|
||||
if ( $times < 3 ) {
|
||||
$times = 3;
|
||||
}
|
||||
|
||||
return ( $this->get_indexables_list_size() * \intval( $times ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the minimum threshold for the amount of posts in the site, in order for lists to be relevant.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return int The size of the Indexables lists.
|
||||
*/
|
||||
public function get_minimum_posts_threshold() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
/**
|
||||
* Filter 'wpseo_posts_threshold' - Allow filtering the minimum threshold for the amount of posts in the site, in order for Indexable lists to be relevant.
|
||||
*
|
||||
* @param int $post_threshold The minimum threshold for the amount of posts in the site, in order for Indexable lists to be relevant.
|
||||
*/
|
||||
return \apply_filters_deprecated( 'wpseo_posts_threshold', [ self::POSTS_THRESHOLD ], 'Yoast SEO 20.4' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the minimum threshold for the amount of analyzed posts in the site, in order for lists to be relevant.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return int The size of the Indexables lists.
|
||||
*/
|
||||
public function get_minimum_analyzed_posts_threshold() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
/**
|
||||
* Filter 'wpseo_analyzed_posts_threshold' - Allow filtering the minimum threshold for the amount of analyzed posts in the site, in order for Indexable lists to be relevant.
|
||||
*
|
||||
* @param int $analysed_post_threshold The minimum threshold for the amount of analyzed posts in the site, in order for Indexable lists to be relevant.
|
||||
*/
|
||||
return \apply_filters_deprecated( 'wpseo_analyzed_posts_threshold', [ self::ANALYSED_POSTS_THRESHOLD ], 'Yoast SEO 20.4' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if link suggestions are enabled or not
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return bool Wether enable_link_suggestions is set to true or not.
|
||||
*/
|
||||
public function get_link_suggestions_enabled() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
return $this->options->get( 'enable_link_suggestions', false ) === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list names that are valid.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array An array with valid list names.
|
||||
*/
|
||||
public function get_list_names() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
$valid_list_names = [
|
||||
'least_readability',
|
||||
'least_seo_score',
|
||||
'most_linked',
|
||||
'least_linked',
|
||||
];
|
||||
|
||||
return $valid_list_names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ignore list names that are valid.
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array An array with valid ignore list names.
|
||||
*/
|
||||
public function get_ignore_list_names() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
$valid_list_names = $this->get_list_names();
|
||||
$valid_ignore_list_names = [];
|
||||
foreach ( $valid_list_names as $valid_list_name ) {
|
||||
$valid_ignore_list_names[] = $valid_list_name . '_ignore_list';
|
||||
}
|
||||
|
||||
return $valid_ignore_list_names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the ignore list name is a valid list name
|
||||
*
|
||||
* @deprecated 20.4
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $list_name The list name.
|
||||
*
|
||||
* @return bool Wether the list name is valid or not.
|
||||
*/
|
||||
public function is_valid_ignore_list_name( $list_name ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
|
||||
|
||||
$valid_list_names = $this->get_ignore_list_names();
|
||||
|
||||
return \in_array( $list_name, $valid_list_names, true );
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Helpers;
|
||||
|
||||
/**
|
||||
* A helper object for the filter_input.
|
||||
*
|
||||
* @deprecated 20.3
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Input_Helper {
|
||||
|
||||
/**
|
||||
* Returns the result of the filter_input. This is mostly a wrapper so we can test.
|
||||
*
|
||||
* @deprecated 20.3
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param int $input_type The type of input constant (e.g. INPUT_POST, INPUT_GET ).
|
||||
* @param string $search_string The property to get from the input.
|
||||
* @param int $filter Optional. The constant that defines the sanitization.
|
||||
*
|
||||
* @return string The result of the get input.
|
||||
*/
|
||||
public function filter( $input_type, $search_string, $filter = \FILTER_DEFAULT ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
|
||||
|
||||
return \filter_input( $input_type, $search_string, $filter );
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user