auto-patch 700-dev-dev01-2024-06-01T22_54_01

This commit is contained in:
root
2024-06-01 22:54:01 +00:00
parent a961f203c3
commit 72a1eb6e5a
123 changed files with 794 additions and 4518 deletions

View File

@@ -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' );
}
}

View File

@@ -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' );
}
}

View File

@@ -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$sSocial 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$sSocial 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$sSocial 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$sSocial settings under the Facebook tab%2$s.',
'wordpress-seo'
),
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
'</a>'
);
}
return '';
}
}

View File

@@ -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 );
}
}

View File

@@ -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;
}
}

View File

@@ -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';
}
}

View File

@@ -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';
}
}

View File

@@ -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 );
}
}

View File

@@ -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 );
}
}

View File

@@ -1,248 +0,0 @@
<?php
namespace Yoast\WP\SEO\Integrations\Admin;
use WPSEO_Addon_Manager;
use WPSEO_Admin_Asset_Manager;
use WPSEO_Shortlinker;
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
use Yoast\WP\SEO\Conditionals\Indexables_Page_Conditional;
use Yoast\WP\SEO\Helpers\Indexables_Page_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Product_Helper;
use Yoast\WP\SEO\Helpers\Short_Link_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Presenters\Admin\Indexing_Error_Presenter;
use Yoast\WP\SEO\Routes\Indexing_Route;
/**
* Indexables_Page_Integration class
*
* @deprecated 20.4
* @codeCoverageIgnore
*/
class Indexables_Page_Integration implements Integration_Interface {
/**
* The shortlinker.
*
* @var WPSEO_Shortlinker
*/
private $shortlinker;
/**
* The admin asset manager.
*
* @var WPSEO_Admin_Asset_Manager
*/
private $admin_asset_manager;
/**
* The short link helper.
*
* @var Short_Link_Helper
*/
protected $short_link_helper;
/**
* The addon manager.
*
* @var WPSEO_Addon_Manager
*/
protected $addon_manager;
/**
* The indexables page helper.
*
* @var Indexables_Page_Helper
*/
private $indexables_page_helper;
/**
* The options helper.
*
* @var Options_Helper
*/
private $options_helper;
/**
* The product helper.
*
* @var Product_Helper
*/
private $product_helper;
/**
* {@inheritDoc}
*
* @deprecated 20.4
* @codeCoverageIgnore
*/
public static function get_conditionals() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
return [
Admin_Conditional::class,
Indexables_Page_Conditional::class,
];
}
/**
* Indexables_Page_Integration constructor.
*
* @param WPSEO_Admin_Asset_Manager $admin_asset_manager The admin asset manager.
* @param WPSEO_Addon_Manager $addon_manager The addon manager.
* @param WPSEO_Shortlinker $shortlinker The shortlinker.
* @param Short_Link_Helper $short_link_helper The short link helper.
* @param Indexables_Page_Helper $indexables_page_helper The indexables page helper.
* @param Options_Helper $options_helper The options helper.
* @param Product_Helper $product_helper The product helper.
*/
public function __construct(
WPSEO_Admin_Asset_Manager $admin_asset_manager,
WPSEO_Addon_Manager $addon_manager,
WPSEO_Shortlinker $shortlinker,
Short_Link_Helper $short_link_helper,
Indexables_Page_Helper $indexables_page_helper,
Options_Helper $options_helper,
Product_Helper $product_helper
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$this->admin_asset_manager = $admin_asset_manager;
$this->addon_manager = $addon_manager;
$this->shortlinker = $shortlinker;
$this->short_link_helper = $short_link_helper;
$this->indexables_page_helper = $indexables_page_helper;
$this->options_helper = $options_helper;
$this->product_helper = $product_helper;
}
/**
* {@inheritDoc}
*
* @deprecated 20.4
* @codeCoverageIgnore
*/
public function register_hooks() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
\add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
}
/**
* Enqueues assets for the Indexables Page.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return void
*/
public function enqueue_assets() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Date is not processed or saved.
if ( ! isset( $_GET['page'] ) || $_GET['page'] !== 'wpseo_dashboard' || \is_network_admin() ) {
return;
}
$this->admin_asset_manager->enqueue_script( 'indexables-page' );
$this->admin_asset_manager->enqueue_style( 'tailwind' );
$this->admin_asset_manager->enqueue_style( 'monorepo' );
$this->admin_asset_manager->enqueue_script( 'indexation' );
$data = [
'disabled' => ! \YoastSEO()->helpers->indexable->should_index_indexables(),
'amount' => \YoastSEO()->helpers->indexing->get_filtered_unindexed_count(),
// Forcing this to 0 to not display the initial alert notice.
'firstTime' => '0',
'errorMessage' => $this->render_indexing_error(),
'restApi' => [
'root' => \esc_url_raw( \rest_url() ),
'indexing_endpoints' => $this->get_endpoints(),
'nonce' => \wp_create_nonce( 'wp_rest' ),
],
];
/**
* Filter: 'wpseo_indexing_data' Filter to adapt the data used in the indexing process.
*
* @param array $data The indexing data to adapt.
*/
$data = \apply_filters( 'wpseo_indexing_data', $data );
$this->admin_asset_manager->localize_script( 'indexation', 'yoastIndexingData', $data );
$this->admin_asset_manager->localize_script(
'indexables-page',
'wpseoIndexablesPageData',
[
'environment' => \wp_get_environment_type(),
'listSize' => $this->indexables_page_helper->get_indexables_list_size(),
'isLinkSuggestionsEnabled' => $this->indexables_page_helper->get_link_suggestions_enabled(),
'isPremium' => $this->product_helper->is_premium(),
'ignoreLists' => [
'least_readability' => $this->options_helper->get( 'least_readability_ignore_list', [] ),
'least_seo_score' => $this->options_helper->get( 'least_seo_score_ignore_list', [] ),
'most_linked' => $this->options_helper->get( 'most_linked_ignore_list', [] ),
'least_linked' => $this->options_helper->get( 'least_linked_ignore_list', [] ),
],
'shortlinks' => [
'orphanedContent' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-orphaned-content' ),
'cornerstoneContent' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-cornerstone-content' ),
'recommendedReadingOne' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-recommended-reading-1' ),
'recommendedReadingTwo' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-recommended-reading-2' ),
'recommendedReadingThree' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-recommended-reading-3' ),
'recommendedReadingFour' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-recommended-reading-4' ),
'recommendedReadingFive' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-recommended-reading-5' ),
'internalLinks' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-internal-linking-suggestions' ),
'getPremium' => $this->shortlinker->build_shortlink( 'https://yoa.st/indexables-get-premium' ),
],
]
);
}
/**
* Retrieves a list of the endpoints to use.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return array The endpoints.
*/
protected function get_endpoints() {
$endpoints = [
'prepare' => Indexing_Route::FULL_PREPARE_ROUTE,
'terms' => Indexing_Route::FULL_TERMS_ROUTE,
'posts' => Indexing_Route::FULL_POSTS_ROUTE,
'archives' => Indexing_Route::FULL_POST_TYPE_ARCHIVES_ROUTE,
'general' => Indexing_Route::FULL_GENERAL_ROUTE,
'indexablesComplete' => Indexing_Route::FULL_INDEXABLES_COMPLETE_ROUTE,
'post_link' => Indexing_Route::FULL_POST_LINKS_INDEXING_ROUTE,
'term_link' => Indexing_Route::FULL_TERM_LINKS_INDEXING_ROUTE,
];
$endpoints = \apply_filters( 'wpseo_indexing_endpoints', $endpoints );
$endpoints['complete'] = Indexing_Route::FULL_COMPLETE_ROUTE;
return $endpoints;
}
/**
* The error to show if optimization failed.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return string The error to show if optimization failed.
*/
protected function render_indexing_error() {
$presenter = new Indexing_Error_Presenter(
$this->short_link_helper,
$this->product_helper,
$this->addon_manager
);
return $presenter->present();
}
}

View File

@@ -1,81 +0,0 @@
<?php
namespace Yoast\WP\SEO\Integrations\Admin;
use WPSEO_Admin_Asset_Manager;
use Yoast\WP\SEO\Conditionals\Admin\Non_Network_Admin_Conditional;
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;
/**
* Redirect_Old_Features_Tab_Integration class
*
* @deprecated 20.4
* @codeCoverageIgnore
*/
class Redirect_Old_Features_Tab_Integration implements Integration_Interface {
/**
* Asset manager instance.
*
* @var WPSEO_Admin_Asset_Manager
*/
protected $asset_manager;
/**
* Redirect_Old_Features_Tab_Integration constructor.
*
* @param WPSEO_Admin_Asset_Manager $asset_manager The admin asset manager.
*/
public function __construct( WPSEO_Admin_Asset_Manager $asset_manager ) {
$this->asset_manager = $asset_manager;
}
/**
* {@inheritDoc}
*
* @deprecated 20.4
* @codeCoverageIgnore
*/
public function register_hooks() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
\add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_redirect_old_features_tab_script' ] );
}
/**
* Returns the conditionals based on which this loadable should be active.
*
* In this case: only when on an admin page and on a non-multisite installation.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return array The conditionals.
*/
public static function get_conditionals() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
return [
Admin_Conditional::class,
Non_Network_Admin_Conditional::class,
];
}
/**
* Enqueues the redirect-old-features-tab script.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return void
*/
public function enqueue_redirect_old_features_tab_script() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Date is not processed or saved.
if ( ! isset( $_GET['page'] ) || $_GET['page'] !== 'wpseo_dashboard' ) {
return;
}
$this->asset_manager->enqueue_script( 'redirect-old-features-tab' );
}
}

View File

@@ -1,304 +0,0 @@
<?php
namespace Yoast\WP\SEO\Integrations\Admin;
use WP_Taxonomy;
use WPSEO_Admin_Editor_Specific_Replace_Vars;
use WPSEO_Admin_Recommended_Replace_Vars;
use WPSEO_Admin_Utils;
use WPSEO_Replacevar_Editor;
use WPSEO_Shortlinker;
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
use Yoast\WP\SEO\Conditionals\Open_Graph_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Presenters\Admin\Alert_Presenter;
use Yoast\WP\SEO\Presenters\Admin\Badge_Presenter;
use Yoast\WP\SEO\Presenters\Admin\Premium_Badge_Presenter;
use Yoast_Form;
/**
* Class Social_Templates_Integration.
*
* Adds the social fields to the meta tabs for post types, taxonomies and archives.
*
* @deprecated 20.3
* @codeCoverageIgnore
*/
class Social_Templates_Integration implements Integration_Interface {
/**
* Service that can be used to recommend a set of variables for a WPSEO_Replacevar_Editor.
*
* @var WPSEO_Admin_Recommended_Replace_Vars
*/
private $recommended_replace_vars;
/**
* Service that can be used to recommend an editor specific set of variables for a WPSEO_Replacevar_Editor.
*
* @var WPSEO_Admin_Editor_Specific_Replace_Vars
*/
private $editor_specific_replace_vars;
/**
* Group to which the 'New' badges belong to.
*
* @var string
*/
private $group = 'global-templates';
/**
* Returns the conditionals based in which this loadable should be active.
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @return array
*/
public static function get_conditionals() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
return [ Admin_Conditional::class, Open_Graph_Conditional::class ];
}
/**
* Initializes the integration.
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @return void
*/
public function register_hooks() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
\add_action( 'Yoast\WP\SEO\admin_author_archives_meta_internal', [ $this, 'social_author_archives' ] );
\add_action( 'Yoast\WP\SEO\admin_date_archives_meta_internal', [ $this, 'social_date_archives' ] );
\add_action( 'Yoast\WP\SEO\admin_post_types_beforearchive_internal', [ $this, 'social_post_type' ], \PHP_INT_MAX, 2 );
\add_action( 'Yoast\WP\SEO\admin_post_types_archive_internal', [ $this, 'social_post_types_archive' ], 10, 2 );
\add_action( 'Yoast\WP\SEO\admin_taxonomies_meta_internal', [ $this, 'social_taxonomies' ], 10, 2 );
}
/**
* Returns the recommended replacements variables object, creating it if needed.
*
* @return WPSEO_Admin_Recommended_Replace_Vars
*/
protected function get_admin_recommended_replace_vars() {
if ( \is_null( $this->recommended_replace_vars ) ) {
$this->recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
}
return $this->recommended_replace_vars;
}
/**
* Returns the editor specific replacements variables object, creating it if needed.
*
* @return WPSEO_Admin_Editor_Specific_Replace_Vars
*/
protected function get_admin_editor_specific_replace_vars() {
if ( \is_null( $this->editor_specific_replace_vars ) ) {
$this->editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
}
return $this->editor_specific_replace_vars;
}
/**
* Build a set of social fields for the author archives in the Search Appearance section.
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @param Yoast_Form $yform The form builder.
*
* @return void
*/
public function social_author_archives( $yform ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
$identifier = 'author-wpseo';
$page_type_recommended = $this->get_admin_recommended_replace_vars()->determine_for_archive( 'author' );
$page_type_specific = $this->get_admin_editor_specific_replace_vars()->determine_for_archive( 'author' );
$this->build_social_fields( $yform, $identifier, $page_type_recommended, $page_type_specific );
}
/**
* Build a set of social fields for the date archives in the Search Appearance section.
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @param Yoast_Form $yform The form builder.
*
* @return void
*/
public function social_date_archives( $yform ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
$identifier = 'archive-wpseo';
$page_type_recommended = $this->get_admin_recommended_replace_vars()->determine_for_archive( 'date' );
$page_type_specific = $this->get_admin_editor_specific_replace_vars()->determine_for_archive( 'date' );
$this->build_social_fields( $yform, $identifier, $page_type_recommended, $page_type_specific );
}
/**
* Build a set of social fields for the post types in the Search Appearance section.
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @param Yoast_Form $yform The form builder.
* @param string $post_type_name The name of the current post_type that gets the social fields added.
*
* @return void
*/
public function social_post_type( $yform, $post_type_name ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
if ( $post_type_name === 'attachment' ) {
return;
}
$page_type_recommended = $this->get_admin_recommended_replace_vars()->determine_for_post_type( $post_type_name );
$page_type_specific = $this->get_admin_editor_specific_replace_vars()->determine_for_post_type( $post_type_name );
$this->build_social_fields( $yform, $post_type_name, $page_type_recommended, $page_type_specific );
}
/**
* Build a set of social fields for the post types archives in the Search Appearance section.
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @param Yoast_Form $yform The form builder.
* @param string $post_type_name The name of the current post_type that gets the social fields added.
*
* @return void
*/
public function social_post_types_archive( $yform, $post_type_name ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
$identifier = 'ptarchive-' . $post_type_name;
$page_type_recommended = $this->get_admin_recommended_replace_vars()->determine_for_archive( $post_type_name );
$page_type_specific = $this->get_admin_editor_specific_replace_vars()->determine_for_archive( $post_type_name );
$this->build_social_fields( $yform, $identifier, $page_type_recommended, $page_type_specific );
}
/**
* Build a set of social fields for the taxonomies in the Search Appearance section.
*
* @deprecated 20.3
* @codeCoverageIgnore
*
* @param Yoast_Form $yform The form builder.
* @param WP_Taxonomy $taxonomy The taxonomy that gets the social fields added.
*
* @return void
*/
public function social_taxonomies( $yform, $taxonomy ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.3' );
$identifier = 'tax-' . $taxonomy->name;
$page_type_recommended = $this->get_admin_recommended_replace_vars()->determine_for_term( $taxonomy->name );
$page_type_specific = $this->get_admin_editor_specific_replace_vars()->determine_for_term( $taxonomy->name );
$this->build_social_fields( $yform, $identifier, $page_type_recommended, $page_type_specific );
}
/**
* Build a set of social fields for the Search Appearance section.
*
* @param Yoast_Form $yform The form builder.
* @param string $identifier A page-wide unique identifier for data storage and unique DOM elements.
* @param string $page_type_recommended Recommended type of page for a list of replaceable variables.
* @param string $page_type_specific Editor specific type of page for a list of replaceable variables.
*
* @return void
*/
protected function build_social_fields( Yoast_Form $yform, $identifier, $page_type_recommended, $page_type_specific ) {
$image_url_field_id = 'social-image-url-' . $identifier;
$image_id_field_id = 'social-image-id-' . $identifier;
$is_premium = \YoastSEO()->helpers->product->is_premium();
$is_premium_16_5_or_up = \defined( '\WPSEO_PREMIUM_VERSION' ) && \version_compare( \WPSEO_PREMIUM_VERSION, '16.5-RC0', '>=' );
$is_form_enabled = $is_premium && $is_premium_16_5_or_up;
$section_class = 'yoast-settings-section';
if ( ! $is_form_enabled ) {
$section_class .= ' yoast-settings-section-disabled';
}
\printf( '<div class="%s">', \esc_attr( $section_class ) );
echo '<div class="social-settings-heading-container">';
echo '<h3 class="social-settings-heading">' . \esc_html__( 'Social settings', 'wordpress-seo' ) . '</h3>';
if ( $is_form_enabled ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Is correctly escaped in the Premium_Badge_Presenter.
echo new Premium_Badge_Presenter( 'global-templates-' . $identifier );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Is correctly escaped in the Badge_Presenter.
echo new Badge_Presenter( 'global-templates-' . $identifier, '', $this->group );
}
echo '</div>';
$yform->hidden( $image_url_field_id, $image_url_field_id );
$yform->hidden( $image_id_field_id, $image_id_field_id );
\printf(
'<div
id="%1$s"
data-react-image-portal
data-react-image-portal-target-image="%2$s"
data-react-image-portal-target-image-id="%3$s"
data-react-image-portal-is-disabled="%4$s"
data-react-image-portal-has-image-validation="%5$s"
></div>',
\esc_attr( 'yoast-social-' . $identifier . '-image-select' ),
\esc_attr( $image_url_field_id ),
\esc_attr( $image_id_field_id ),
\esc_attr( ! $is_form_enabled ),
true
);
$editor = new WPSEO_Replacevar_Editor(
$yform,
[
'title' => 'social-title-' . $identifier,
'description' => 'social-description-' . $identifier,
'page_type_recommended' => $page_type_recommended,
'page_type_specific' => $page_type_specific,
'paper_style' => false,
'label_title' => \__( 'Social title', 'wordpress-seo' ),
'label_description' => \__( 'Social description', 'wordpress-seo' ),
'description_placeholder' => '',
'is_disabled' => ! $is_form_enabled,
]
);
$editor->render();
if ( $is_premium && ! $is_premium_16_5_or_up ) {
echo '<div class="yoast-settings-section-upsell">';
$unlock_alert = \sprintf(
/* translators: %s expands to 'Yoast SEO Premium'. */
\esc_html__( 'To unlock this feature please update %s to the latest version.', 'wordpress-seo' ),
'Yoast SEO Premium'
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped above.
echo new Alert_Presenter( $unlock_alert );
echo '</div>';
}
if ( ! $is_premium ) {
echo '<div class="yoast-settings-section-upsell">';
echo '<a class="yoast-button-upsell" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" href="' . \esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/4e0' ) ) . '" target="_blank">'
. \esc_html__( 'Unlock with Premium', 'wordpress-seo' )
// phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
. WPSEO_Admin_Utils::get_new_tab_message()
. '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>'
. '</a>';
echo '</div>';
}
echo '</div>';
}
}

View File

@@ -1,69 +0,0 @@
<?php
namespace Yoast\WP\SEO\Integrations\Admin;
use Yoast\WP\SEO\Conditionals\Yoast_Admin_And_Dashboard_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;
/**
* Class Unsupported_PHP_Version.
*
* @package Yoast\WP\SEO\Integrations\Admin
*
* @deprecated 20.4
* @codeCoverageIgnore
*/
class Unsupported_PHP_Version implements Integration_Interface {
/**
* Returns the conditionals based on which this integration should be active.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return array The array of conditionals.
*/
public static function get_conditionals() {
\_deprecated_function( __METHOD__, 'WPSEO 20.4' );
return [
Yoast_Admin_And_Dashboard_Conditional::class,
];
}
/**
* Register hooks.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return void
*/
public function register_hooks() {
\_deprecated_function( __METHOD__, 'WPSEO 20.4' );
}
/**
* Checks the current PHP version.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return void
*/
public function check_php_version() {
\_deprecated_function( __METHOD__, 'WPSEO 20.4' );
}
/**
* Composes the body of the message to display.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return string The message to display.
*/
public function body() {
\_deprecated_function( __METHOD__, 'WPSEO 20.4' );
return '';
}
}

View File

@@ -1,122 +0,0 @@
<?php
namespace Yoast\WP\SEO\Integrations;
use WPSEO_Admin_Asset_Manager;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
use Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional;
use Yoast\WP\SEO\Helpers\Short_Link_Helper;
/**
* Loads schema block templates into Gutenberg.
*
* @deprecated 20.5
* @codeCoverageIgnore
*/
class Schema_Blocks implements Integration_Interface {
use No_Conditionals;
/**
* The registered templates.
*
* @var string[]
*/
protected $templates = [];
/**
* Contains the asset manager.
*
* @var WPSEO_Admin_Asset_Manager
*/
protected $asset_manager;
/**
* Represents the schema blocks conditional.
*
* @var Schema_Blocks_Conditional
*/
protected $blocks_conditional;
/**
* Represents the short link helper.
*
* @var Short_Link_Helper
*/
protected $short_link_helper;
/**
* Schema_Blocks constructor.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param WPSEO_Admin_Asset_Manager $asset_manager The asset manager.
* @param Schema_Blocks_Conditional $blocks_conditional The schema blocks conditional.
* @param Short_Link_Helper $short_link_helper The short link helper.
*/
public function __construct(
WPSEO_Admin_Asset_Manager $asset_manager,
Schema_Blocks_Conditional $blocks_conditional,
Short_Link_Helper $short_link_helper
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
$this->asset_manager = $asset_manager;
$this->blocks_conditional = $blocks_conditional;
$this->short_link_helper = $short_link_helper;
}
/**
* Initializes the integration.
*
* This is the place to register hooks and filters.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @return void
*/
public function register_hooks() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
}
/**
* Registers a schema template.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param string $template The template to be registered.
* If starting with a / is assumed to be an absolute path.
* If not starting with a / is assumed to be relative to WPSEO_PATH.
*
* @return void
*/
public function register_template( $template ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
}
/**
* Loads all schema block templates and the required JS library for them.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @return void
*/
public function load() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
}
/**
* Outputs the set templates.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @return void
*/
public function output() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
}
}

View File

@@ -1,637 +0,0 @@
<?php
namespace Yoast\WP\SEO\Routes;
use WP_Error;
use WP_REST_Request;
use WP_REST_Response;
use Yoast\WP\SEO\Actions\Indexables_Page_Action;
use Yoast\WP\SEO\Conditionals\Indexables_Page_Conditional;
use Yoast\WP\SEO\Helpers\Indexables_Page_Helper;
use Yoast\WP\SEO\Main;
/**
* Indexables_Page_Route class.
*
* @deprecated 20.4
* @codeCoverageIgnore
*/
class Indexables_Page_Route implements Route_Interface {
/**
* Represents the route that retrieves the neccessary information for setting up the Indexables Page.
*
* @var string
*/
public const SETUP_INFO = '/setup_info';
/**
* Represents the least readability route.
*
* @var string
*/
public const LEAST_READABILITY_ROUTE = '/least_readability';
/**
* Represents the least SEO score route.
*
* @var string
*/
public const LEAST_SEO_SCORE_ROUTE = '/least_seo_score';
/**
* Represents the most linked route.
*
* @var string
*/
public const MOST_LINKED_ROUTE = '/most_linked';
/**
* Represents the least linked route.
*
* @var string
*/
public const LEAST_LINKED_ROUTE = '/least_linked';
/**
* Allows to mark an indexable to be ignored.
*
* @var string
*/
public const UPDATE_IGNORED_INDEXABLES_ROUTE = '/update_ignored_indexables';
/**
* Allows to restore an indexable previously ignored.
*
* @var string
*/
public const RESTORE_INDEXABLE_ROUTE = '/restore_indexable';
/**
* Allows to restore all indexables previously ignored.
*
* @var string
*/
public const RESTORE_ALL_INDEXABLES_ROUTE = '/restore_all_indexables';
/**
* Allows to restore all indexables previously ignored for a certain list.
*
* @var string
*/
public const RESTORE_ALL_INDEXABLES_FOR_LIST_ROUTE = '/restore_all_indexables_for_list';
/**
* Gets the reading list state.
*
* @var string
*/
public const GET_READING_LIST_STATE = '/get_reading_list';
/**
* Sets the reading list state.
*
* @var string
*/
public const SET_READING_LIST_STATE = '/set_reading_list';
/**
* The indexable actions.
*
* @var Indexables_Page_Action
*/
private $indexables_page_action;
/**
* The indexables page helper.
*
* @var Indexables_Page_Helper
*/
private $indexables_page_helper;
/**
* Indexables_Route constructor.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @param Indexables_Page_Action $indexables_page_action The indexable actions.
* @param Indexables_Page_Helper $indexables_page_helper The indexables page helper.
*/
public function __construct( Indexables_Page_Action $indexables_page_action, Indexables_Page_Helper $indexables_page_helper ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$this->indexables_page_action = $indexables_page_action;
$this->indexables_page_helper = $indexables_page_helper;
}
/**
* {@inheritDoc}
*
* @deprecated 20.4
* @codeCoverageIgnore
*/
public static function get_conditionals() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
return [
Indexables_Page_Conditional::class,
];
}
/**
* Permission callback.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return bool true when user has 'edit_others_posts' permission.
*/
public static function permission_edit_others_posts() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
return \current_user_can( 'edit_others_posts' );
}
/**
* Registers routes with WordPress.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return void
*/
public function register_routes() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$setup_info_route = [
[
'methods' => 'GET',
'callback' => [ $this, 'get_setup_info' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::SETUP_INFO, $setup_info_route );
$least_readability_route = [
[
'methods' => 'GET',
'callback' => [ $this, 'get_least_readable' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::LEAST_READABILITY_ROUTE, $least_readability_route );
$least_seo_score_route = [
[
'methods' => 'GET',
'callback' => [ $this, 'get_least_seo_score' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::LEAST_SEO_SCORE_ROUTE, $least_seo_score_route );
$most_linked_route = [
[
'methods' => 'GET',
'callback' => [ $this, 'get_most_linked' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::MOST_LINKED_ROUTE, $most_linked_route );
$least_linked_route = [
[
'methods' => 'GET',
'callback' => [ $this, 'get_least_linked' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::LEAST_LINKED_ROUTE, $least_linked_route );
$update_ignored_indexables_route = [
[
'methods' => 'POST',
'callback' => [ $this, 'update_ignored_indexables' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
'args' => [
'id' => [
'type' => 'integer',
'minimum' => 0,
],
'type' => [
'type' => 'string',
'enum' => [
'least_readability',
'least_seo_score',
'most_linked',
'least_linked',
],
],
],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::UPDATE_IGNORED_INDEXABLES_ROUTE, $update_ignored_indexables_route );
$restore_indexable_route = [
[
'methods' => 'POST',
'callback' => [ $this, 'restore_indexable' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
'args' => [
'id' => [
'type' => 'integer',
'minimum' => 0,
],
'type' => [
'type' => 'string',
'enum' => [
'least_readability',
'least_seo_score',
'most_linked',
'least_linked',
],
],
],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::RESTORE_INDEXABLE_ROUTE, $restore_indexable_route );
$restore_all_indexables_route = [
[
'methods' => 'POST',
'callback' => [ $this, 'restore_all_indexables' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::RESTORE_ALL_INDEXABLES_ROUTE, $restore_all_indexables_route );
$restore_all_indexables_for_list_route = [
[
'methods' => 'POST',
'callback' => [ $this, 'restore_all_indexables_for_list' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
'args' => [
'type' => [
'type' => 'string',
'enum' => [
'least_readability',
'least_seo_score',
'most_linked',
'least_linked',
],
],
],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::RESTORE_ALL_INDEXABLES_FOR_LIST_ROUTE, $restore_all_indexables_for_list_route );
$get_reading_list_route = [
[
'methods' => 'GET',
'callback' => [ $this, 'get_reading_list' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::GET_READING_LIST_STATE, $get_reading_list_route );
$set_reading_list_route = [
[
'methods' => 'POST',
'callback' => [ $this, 'set_reading_list' ],
'permission_callback' => [ $this, 'permission_edit_others_posts' ],
'args' => [
'state' => [
'type' => 'array',
],
],
],
];
\register_rest_route( Main::API_V1_NAMESPACE, self::SET_READING_LIST_STATE, $set_reading_list_route );
}
/**
* Gets the necessary information to set up the indexables page.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return WP_REST_Response The neccessary information to set up the indexables page.
*/
public function get_setup_info() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$setup_info = $this->indexables_page_action->get_setup_info( $this->indexables_page_helper->get_minimum_posts_threshold(), $this->indexables_page_helper->get_minimum_analyzed_posts_threshold() );
return new WP_REST_Response(
[
'json' => $setup_info,
]
);
}
/**
* Gets the posts with the smallest readability scores.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return WP_REST_Response The posts with the smallest readability scores.
*/
public function get_least_readable() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$least_readable = $this->indexables_page_action->get_least_readable( $this->indexables_page_helper->get_buffer_size() );
return new WP_REST_Response(
[
'json' => [
'list' => $least_readable,
'length' => \count( $least_readable ),
],
]
);
}
/**
* Gets the posts with the smallest readability scores.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return WP_REST_Response The posts with the smallest readability scores.
*/
public function get_least_seo_score() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$least_seo_score = $this->indexables_page_action->get_least_seo_score( $this->indexables_page_helper->get_buffer_size() );
return new WP_REST_Response(
[
'json' => [
'list' => $least_seo_score,
'length' => \count( $least_seo_score ),
],
]
);
}
/**
* Gets the most linked posts.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return WP_REST_Response The most linked posts.
*/
public function get_most_linked() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$most_linked = $this->indexables_page_action->get_most_linked( $this->indexables_page_helper->get_buffer_size() );
return new WP_REST_Response(
[
'json' => [
'list' => $most_linked,
'length' => \count( $most_linked ),
],
]
);
}
/**
* Gets the least linked posts.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return WP_REST_Response The most linked posts.
*/
public function get_least_linked() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$least_linked = $this->indexables_page_action->get_least_linked( $this->indexables_page_helper->get_buffer_size() );
return new WP_REST_Response(
[
'json' => [
'list' => $least_linked,
'length' => \count( $least_linked ),
],
]
);
}
/**
* Adds an indexable id in the ignore list.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request object.
*
* @return WP_REST_Response|WP_Error The success or failure response.
*/
public function update_ignored_indexables( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$params = $request->get_json_params();
$ignore_list_name = $params['type'] . '_ignore_list';
$ignored_indexable_ids = \array_map(
static function ( $ignored_indexable_id ) {
return \intval( $ignored_indexable_id );
},
$params['list']
);
if ( $this->indexables_page_action->update_ignored_indexables( $ignore_list_name, $ignored_indexable_ids ) ) {
return new WP_REST_Response(
[
'json' => (object) [ 'success' => true ],
],
200
);
}
return new WP_Error(
'ignore_failed',
'Could not save the option in the database',
[
'status' => 500,
]
);
}
/**
* Restores an indexable id from the ignore list.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request object.
*
* @return WP_REST_Response|WP_Error The success or failure response.
*/
public function restore_indexable( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$params = $request->get_json_params();
$ignore_list_name = $params['type'] . '_ignore_list';
$indexable_id = \intval( $params['id'] );
if ( $this->indexables_page_action->remove_indexable_from_ignore_list( $ignore_list_name, $indexable_id ) ) {
return new WP_REST_Response(
[
'json' => (object) [ 'success' => true ],
],
200
);
}
return new WP_Error(
'restore_failed',
'Could not save the option in the database',
[
'status' => 500,
]
);
}
/**
* Restores all indexables from all ignore lists.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return WP_REST_Response|WP_Error The success or failure response.
*/
public function restore_all_indexables() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$list_names = $this->indexables_page_helper->get_ignore_list_names();
$success = true;
foreach ( $list_names as $list_name ) {
$result = $this->indexables_page_action->remove_all_indexables_from_ignore_list( $list_name );
if ( $result === false ) {
$success = false;
}
}
if ( $success === true ) {
return new WP_REST_Response(
[
'json' => (object) [ 'success' => true ],
],
200
);
}
return new WP_Error(
'restore_all_failed',
'Could not save the option in the database',
[
'status' => 500,
]
);
}
/**
* Restores all indexables from a specific ignore list.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request object.
*
* @return WP_REST_Response|WP_Error The success or failure response.
*/
public function restore_all_indexables_for_list( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$params = $request->get_json_params();
$ignore_list_name = $params['type'] . '_ignore_list';
if ( $this->indexables_page_action->remove_all_indexables_from_ignore_list( $ignore_list_name ) ) {
return new WP_REST_Response(
[
'json' => (object) [ 'success' => true ],
],
200
);
}
return new WP_Error(
'restore_all_list_failed',
'Could not save the option in the database',
[
'status' => 500,
]
);
}
/**
* Gets the state of the reading list.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @return WP_REST_Response A list of boolean values which are true if an article has been flagged as read.
*/
public function get_reading_list() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$reading_list = $this->indexables_page_action->get_reading_list();
return new WP_REST_Response(
[
'json' => [
'state' => $reading_list,
],
]
);
}
/**
* Sets the state of the reading list.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request object.
*
* @return WP_REST_Response|WP_Error The success or failure response.
*/
public function set_reading_list( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$params = $request->get_json_params();
$reading_list_state = \array_map(
static function ( $article ) {
return \boolval( $article );
},
$params['state']
);
if ( $this->indexables_page_action->set_reading_list( $reading_list_state ) ) {
return new WP_REST_Response(
[
'json' => (object) [ 'success' => true ],
],
200
);
}
return new WP_Error(
'set_list_failed',
'Could not save the option in the database',
[
'status' => 500,
]
);
}
}

View File

@@ -1,278 +0,0 @@
<?php
namespace Yoast\WP\SEO\Routes;
use Exception;
use WP_Error;
use WP_REST_Request;
use WP_REST_Response;
use Yoast\WP\SEO\Actions\Settings_Introduction_Action;
use Yoast\WP\SEO\Conditionals\Settings_Conditional;
use Yoast\WP\SEO\Main;
/**
* Settings_Introduction_Route class.
*
* @deprecated 20.7
* @codeCoverageIgnore
*/
class Settings_Introduction_Route implements Route_Interface {
/**
* Represents the Settings_Introduction_Route prefix.
*
* @var string
*/
public const ROUTE_PREFIX = '/settings_introduction';
/**
* Represents the Wistia embed permission.
*
* @var string
*/
public const WISTIA_EMBED_PERMISSION = self::ROUTE_PREFIX . '/wistia_embed_permission';
/**
* Represents showing the introduction.
*
* @var string
*/
public const SHOW = self::ROUTE_PREFIX . '/show';
/**
* Holds the Settings_Introduction_Action.
*
* @var Settings_Introduction_Action
*/
private $settings_introduction_action;
/**
* Constructs Settings_Introduction_Route.
*
* @deprecated 20.7
* @codeCoverageIgnore
*
* @param Settings_Introduction_Action $settings_introduction_action The $settings_introduction_action.
*/
public function __construct( Settings_Introduction_Action $settings_introduction_action ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
$this->settings_introduction_action = $settings_introduction_action;
}
/**
* {@inheritDoc}
*
* @deprecated 20.7
* @codeCoverageIgnore
*/
public static function get_conditionals() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
return [ Settings_Conditional::class ];
}
/**
* Permission callback.
*
* @deprecated 20.7
* @codeCoverageIgnore
*
* @return bool True when user has 'wpseo_manage_options' permission.
*/
public static function permission_manage_options() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
return \current_user_can( 'wpseo_manage_options' );
}
/**
* Registers routes with WordPress.
*
* @deprecated 20.7
* @codeCoverageIgnore
*
* @return void
*/
public function register_routes() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
\register_rest_route(
Main::API_V1_NAMESPACE,
self::WISTIA_EMBED_PERMISSION,
[
[
'methods' => 'GET',
'callback' => [ $this, 'get_wistia_embed_permission' ],
'permission_callback' => [ $this, 'permission_manage_options' ],
],
[
'methods' => 'POST',
'callback' => [ $this, 'set_wistia_embed_permission' ],
'permission_callback' => [ $this, 'permission_manage_options' ],
'args' => [
'value' => [
'required' => true,
'type' => 'bool',
],
],
],
]
);
\register_rest_route(
Main::API_V1_NAMESPACE,
self::SHOW,
[
[
'methods' => 'GET',
'callback' => [ $this, 'get_show' ],
'permission_callback' => [ $this, 'permission_manage_options' ],
],
[
'methods' => 'POST',
'callback' => [ $this, 'set_show' ],
'permission_callback' => [ $this, 'permission_manage_options' ],
'args' => [
'value' => [
'required' => true,
'type' => 'bool',
],
],
],
]
);
}
/**
* Gets the value of the wistia embed permission.
*
* @deprecated 20.7
* @codeCoverageIgnore
*
* @return WP_REST_Response|WP_Error The response, or an error.
*/
public function get_wistia_embed_permission() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
try {
$value = $this->settings_introduction_action->get_wistia_embed_permission();
} catch ( Exception $exception ) {
return new WP_Error(
'wpseo_settings_introduction_error',
$exception->getMessage(),
(object) []
);
}
return new WP_REST_Response(
[
'json' => (object) [
'value' => $value,
],
]
);
}
/**
* Sets the value of the wistia embed permission.
*
* @deprecated 20.7
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request object.
*
* @return WP_REST_Response|WP_Error The success or failure response.
*/
public function set_wistia_embed_permission( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
$params = $request->get_json_params();
$value = \boolval( $params['value'] );
try {
$result = $this->settings_introduction_action->set_wistia_embed_permission( $value );
} catch ( Exception $exception ) {
return new WP_Error(
'wpseo_settings_introduction_error',
$exception->getMessage(),
(object) []
);
}
return new WP_REST_Response(
[
'json' => (object) [
'success' => $result,
],
],
( $result ) ? 200 : 400
);
}
/**
* Gets the value of show.
*
* @deprecated 20.7
* @codeCoverageIgnore
*
* @return WP_REST_Response|WP_Error The response, or an error.
*/
public function get_show() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
try {
$value = $this->settings_introduction_action->get_show();
} catch ( Exception $exception ) {
return new WP_Error(
'wpseo_settings_introduction_error',
$exception->getMessage(),
(object) []
);
}
return new WP_REST_Response(
[
'json' => (object) [
'value' => $value,
],
]
);
}
/**
* Sets the value of show.
*
* @deprecated 20.7
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request object.
*
* @return WP_REST_Response|WP_Error The success or failure response.
*/
public function set_show( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.7' );
$params = $request->get_json_params();
$value = \boolval( $params['value'] );
try {
$result = $this->settings_introduction_action->set_show( $value );
} catch ( Exception $exception ) {
return new WP_Error(
'wpseo_settings_introduction_error',
$exception->getMessage(),
(object) []
);
}
return new WP_REST_Response(
[
'json' => (object) [
'success' => $result,
],
],
( $result ) ? 200 : 400
);
}
}

View File

@@ -1,393 +0,0 @@
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded
// phpcs:disable Yoast.NamingConventions.NamespaceName.Invalid
namespace Yoast\WP\SEO\Schema_Templates\Assets;
/**
* Class Icons.
*
* Provides SVG icons as strings.
*
* @deprecated 20.5
* @codeCoverageIgnore
*/
class Icons {
/**
* Represents the start of the SVG tag.
*/
public const SVG_START_TAG = "<svg xmlns='http://www.w3.org/2000/svg' fill='none' style='fill:none' viewBox='0 0 24 24' stroke='currentColor' height='%SIZE%' width='%SIZE%' >";
/**
* The default height and width of an icon.
*/
public const SIZE_DEFAULT = 24;
/**
* The height and width of an icon in a variation picker.
*/
public const SIZE_VARIATION = 36;
/**
* The Heroicons academic cap svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_academic_cap( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path fill='#fff' d='M12 14l9-5-9-5-9 5 9 5z' />"
. "<path fill='#fff' d='M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z' />"
. "<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222' />",
$size
);
}
/**
* The Heroicons annotation svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_annotation( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z' />",
$size
);
}
/**
* The Heroicons ban svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_ban( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636' />",
$size
);
}
/**
* The Heroicons briefcase svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_briefcase( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' />",
$size
);
}
/**
* The Heroicons calendar svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_calendar( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z' />",
$size
);
}
/**
* The Heroicons clipboard check svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_clipboard_check( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4' />",
$size
);
}
/**
* The Heroicons clipboard copy svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_clipboard_copy( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3' />",
$size
);
}
/**
* The Heroicons clipboard list svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_clipboard_list( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01' />",
$size
);
}
/**
* The Heroicons clock svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_clock( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z' />",
$size
);
}
/**
* The Heroicons currency dollar svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_currency_dollar( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z' />",
$size
);
}
/**
* The Heroicons cursor_click svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_cursor_click( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122' />",
$size
);
}
/**
* The Heroicons document text svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_document_text( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z' />",
$size
);
}
/**
* The Heroicons globe svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_globe( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z' />",
$size
);
}
/**
* The Heroicons identification svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_identification( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2' />",
$size
);
}
/**
* The Heroicons location marker svg icon
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_location_marker( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z' />"
. "<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 11a3 3 0 11-6 0 3 3 0 016 0z' />",
$size
);
}
/**
* The Heroicons office building svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_office_building( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path d='M19 21V5C19 3.89543 18.1046 3 17 3H7C5.89543 3 5 3.89543 5 5V21M19 21L21 21M19 21H14M5 21L3 21M5 21H10M9 6.99998H10M9 11H10M14 6.99998H15M14 11H15M10 21V16C10 15.4477 10.4477 15 11 15H13C13.5523 15 14 15.4477 14 16V21M10 21H14' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>",
$size
);
}
/**
* The Heroicons photograph svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_photograph( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z' />",
$size
);
}
/**
* The Heroicons switch horizontal svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
* @return string
*/
public static function heroicons_switch_horizontal( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4' />",
$size
);
}
/**
* The Heroicons grid svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
*
* @return string The generated icon.
*/
public static function heroicons_grid( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z' />",
$size
);
}
/**
* The Heroicons book open svg icon.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param int $size The Height and Width of the SVG icon.
*
* @return string The generated icon.
*/
public static function heroicons_book_open( $size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
return self::svg(
"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253' />",
$size
);
}
/**
* Generates the SVG based on given path.
*
* @deprecated 20.5
* @codeCoverageIgnore
*
* @param string $path The path to generate svg for.
* @param int $svg_size The Height and Width of the SVG icon.
*
* @return string The generated icon svg.
*/
protected static function svg( $path, $svg_size = self::SIZE_DEFAULT ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.5' );
$start = \str_replace( '%SIZE%', $svg_size, self::SVG_START_TAG );
return $start . $path . '</svg>';
}
}

View File

@@ -1 +1 @@
<?php return array('reduxJsToolkit.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-redux-package'), 'version' => '425acbd30b98c737df6e'), 'analysisReport.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'f4095bb34618cc5f80db'), 'componentsNew.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-i18n', 'wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-react-select', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '9a99c56342d24b8e8d5c'), 'featureFlag.js' => array('dependencies' => array('wp-polyfill'), 'version' => '91e54e3dd01f59a724ae'), 'helpers.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-styled-components-package'), 'version' => 'f38a5f8b9a9ba801e722'), 'replacementVariableEditor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-components', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-draft-js-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'e4ccddb70f4b704e5c16'), 'searchMetadataPreviews.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'd6c26496fda7df191128'), 'socialMetadataForms.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '6c538797b828b87a5419'), 'styleGuide.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-styled-components-package'), 'version' => 'a65ddb8de826da5fea4d'), 'uiLibrary.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-redux-js-toolkit-package'), 'version' => 'f86dff9aecec48a0e53f'), 'chart.js.js' => array('dependencies' => array('wp-polyfill'), 'version' => '196fb6740f0ef8ce192a'), 'draftJs.js' => array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'f03ff0ae2ee1cf6bbc54'), 'jed.js' => array('dependencies' => array('wp-polyfill'), 'version' => '28697086e82ae1cd0e88'), 'propTypes.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4c546a0c9e97b70d3fe0'), 'reactHelmet.js' => array('dependencies' => array('react', 'wp-polyfill', 'yoast-seo-prop-types-package'), 'version' => 'b7d9f84f1dc499388f58'), 'redux.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e83451c8529be91b4af7'), 'styledComponents.js' => array('dependencies' => array('react', 'wp-polyfill'), 'version' => 'f030a78c47ee9be46c07'), 'analysis.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill', 'yoast-seo-feature-flag-package'), 'version' => '8b27425b3e181dd8905d'));
<?php return array('reduxJsToolkit.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-redux-package'), 'version' => '425acbd30b98c737df6e'), 'analysisReport.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'f4095bb34618cc5f80db'), 'componentsNew.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-i18n', 'wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-react-select', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '9a99c56342d24b8e8d5c'), 'featureFlag.js' => array('dependencies' => array('wp-polyfill'), 'version' => '91e54e3dd01f59a724ae'), 'helpers.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-styled-components-package'), 'version' => 'f38a5f8b9a9ba801e722'), 'replacementVariableEditor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-components', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-draft-js-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '3ef02d0813043f65de66'), 'searchMetadataPreviews.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'd6c26496fda7df191128'), 'socialMetadataForms.js' => array('dependencies' => array('lodash', 'react', 'wp-i18n', 'wp-polyfill', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '6c538797b828b87a5419'), 'styleGuide.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-styled-components-package'), 'version' => 'a65ddb8de826da5fea4d'), 'uiLibrary.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-redux-js-toolkit-package'), 'version' => 'f86dff9aecec48a0e53f'), 'chart.js.js' => array('dependencies' => array('wp-polyfill'), 'version' => '196fb6740f0ef8ce192a'), 'draftJs.js' => array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'f03ff0ae2ee1cf6bbc54'), 'jed.js' => array('dependencies' => array('wp-polyfill'), 'version' => '28697086e82ae1cd0e88'), 'propTypes.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4c546a0c9e97b70d3fe0'), 'reactHelmet.js' => array('dependencies' => array('react', 'wp-polyfill', 'yoast-seo-prop-types-package'), 'version' => 'b7d9f84f1dc499388f58'), 'redux.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e83451c8529be91b4af7'), 'styledComponents.js' => array('dependencies' => array('react', 'wp-polyfill'), 'version' => 'f030a78c47ee9be46c07'), 'analysis.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill', 'yoast-seo-feature-flag-package'), 'version' => 'b4d58fc971a5a3a52d1b'));

File diff suppressed because one or more lines are too long

View File

@@ -47,7 +47,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\actions\\importing\\aioseo\\aioseo_validate_data_action' => 'Yoast\\WP\\SEO\\Actions\\Importing\\Aioseo\\Aioseo_Validate_Data_Action',
'yoast\\wp\\seo\\actions\\importing\\deactivate_conflicting_plugins_action' => 'Yoast\\WP\\SEO\\Actions\\Importing\\Deactivate_Conflicting_Plugins_Action',
'yoast\\wp\\seo\\actions\\indexables\\indexable_head_action' => 'Yoast\\WP\\SEO\\Actions\\Indexables\\Indexable_Head_Action',
'yoast\\wp\\seo\\actions\\indexables_page_action' => 'Yoast\\WP\\SEO\\Actions\\Indexables_Page_Action',
'yoast\\wp\\seo\\actions\\indexing\\indexable_general_indexation_action' => 'Yoast\\WP\\SEO\\Actions\\Indexing\\Indexable_General_Indexation_Action',
'yoast\\wp\\seo\\actions\\indexing\\indexable_indexing_complete_action' => 'Yoast\\WP\\SEO\\Actions\\Indexing\\Indexable_Indexing_Complete_Action',
'yoast\\wp\\seo\\actions\\indexing\\indexable_post_indexation_action' => 'Yoast\\WP\\SEO\\Actions\\Indexing\\Indexable_Post_Indexation_Action',
@@ -96,7 +95,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\conditionals\\get_request_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Get_Request_Conditional',
'yoast\\wp\\seo\\conditionals\\headless_rest_endpoints_enabled_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Headless_Rest_Endpoints_Enabled_Conditional',
'yoast\\wp\\seo\\conditionals\\import_tool_selected_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Import_Tool_Selected_Conditional',
'yoast\\wp\\seo\\conditionals\\indexables_page_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Indexables_Page_Conditional',
'yoast\\wp\\seo\\conditionals\\jetpack_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Jetpack_Conditional',
'yoast\\wp\\seo\\conditionals\\migrations_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Migrations_Conditional',
'yoast\\wp\\seo\\conditionals\\new_settings_ui_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\New_Settings_Ui_Conditional',
@@ -109,7 +107,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\conditionals\\premium_inactive_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Premium_Inactive_Conditional',
'yoast\\wp\\seo\\conditionals\\primary_category_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Primary_Category_Conditional',
'yoast\\wp\\seo\\conditionals\\robots_txt_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Robots_Txt_Conditional',
'yoast\\wp\\seo\\conditionals\\schema_blocks_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Schema_Blocks_Conditional',
'yoast\\wp\\seo\\conditionals\\semrush_enabled_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\SEMrush_Enabled_Conditional',
'yoast\\wp\\seo\\conditionals\\settings_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Settings_Conditional',
'yoast\\wp\\seo\\conditionals\\should_index_links_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Should_Index_Links_Conditional',
@@ -216,7 +213,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\helpers\\import_helper' => 'Yoast\\WP\\SEO\\Helpers\\Import_Helper',
'yoast\\wp\\seo\\helpers\\indexable_helper' => 'Yoast\\WP\\SEO\\Helpers\\Indexable_Helper',
'yoast\\wp\\seo\\helpers\\indexable_to_postmeta_helper' => 'Yoast\\WP\\SEO\\Helpers\\Indexable_To_Postmeta_Helper',
'yoast\\wp\\seo\\helpers\\indexables_page_helper' => 'Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper',
'yoast\\wp\\seo\\helpers\\indexing_helper' => 'Yoast\\WP\\SEO\\Helpers\\Indexing_Helper',
'yoast\\wp\\seo\\helpers\\language_helper' => 'Yoast\\WP\\SEO\\Helpers\\Language_Helper',
'yoast\\wp\\seo\\helpers\\meta_helper' => 'Yoast\\WP\\SEO\\Helpers\\Meta_Helper',
@@ -277,7 +273,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\integrations\\admin\\helpscout_beacon' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\HelpScout_Beacon',
'yoast\\wp\\seo\\integrations\\admin\\import_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Import_Integration',
'yoast\\wp\\seo\\integrations\\admin\\indexables_exclude_taxonomy_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Indexables_Exclude_Taxonomy_Integration',
'yoast\\wp\\seo\\integrations\\admin\\indexables_page_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Indexables_Page_Integration',
'yoast\\wp\\seo\\integrations\\admin\\indexing_notification_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Indexing_Notification_Integration',
'yoast\\wp\\seo\\integrations\\admin\\indexing_tool_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Indexing_Tool_Integration',
'yoast\\wp\\seo\\integrations\\admin\\installation_success_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Installation_Success_Integration',
@@ -289,7 +284,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\integrations\\admin\\old_premium_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Old_Premium_Integration',
'yoast\\wp\\seo\\integrations\\admin\\redirect_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Redirect_Integration',
'yoast\\wp\\seo\\integrations\\admin\\redirects_page_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Redirects_Page_Integration',
'yoast\\wp\\seo\\integrations\\admin\\social_templates_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Social_Templates_Integration',
'yoast\\wp\\seo\\integrations\\admin\\unsupported_php_version_notice' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Unsupported_PHP_Version_Notice',
'yoast\\wp\\seo\\integrations\\admin\\workouts_integration' => 'Yoast\\WP\\SEO\\Integrations\\Admin\\Workouts_Integration',
'yoast\\wp\\seo\\integrations\\alerts\\black_friday_product_editor_checklist_notification' => 'Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Product_Editor_Checklist_Notification',
@@ -326,7 +320,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\integrations\\front_end\\wp_robots_integration' => 'Yoast\\WP\\SEO\\Integrations\\Front_End\\WP_Robots_Integration',
'yoast\\wp\\seo\\integrations\\front_end_integration' => 'Yoast\\WP\\SEO\\Integrations\\Front_End_Integration',
'yoast\\wp\\seo\\integrations\\primary_category' => 'Yoast\\WP\\SEO\\Integrations\\Primary_Category',
'yoast\\wp\\seo\\integrations\\schema_blocks' => 'Yoast\\WP\\SEO\\Integrations\\Schema_Blocks',
'yoast\\wp\\seo\\integrations\\settings_integration' => 'Yoast\\WP\\SEO\\Integrations\\Settings_Integration',
'yoast\\wp\\seo\\integrations\\support_integration' => 'Yoast\\WP\\SEO\\Integrations\\Support_Integration',
'yoast\\wp\\seo\\integrations\\third_party\\amp' => 'Yoast\\WP\\SEO\\Integrations\\Third_Party\\AMP',
@@ -405,7 +398,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\routes\\first_time_configuration_route' => 'Yoast\\WP\\SEO\\Routes\\First_Time_Configuration_Route',
'yoast\\wp\\seo\\routes\\importing_route' => 'Yoast\\WP\\SEO\\Routes\\Importing_Route',
'yoast\\wp\\seo\\routes\\indexables_head_route' => 'Yoast\\WP\\SEO\\Routes\\Indexables_Head_Route',
'yoast\\wp\\seo\\routes\\indexables_page_route' => 'Yoast\\WP\\SEO\\Routes\\Indexables_Page_Route',
'yoast\\wp\\seo\\routes\\indexing_route' => 'Yoast\\WP\\SEO\\Routes\\Indexing_Route',
'yoast\\wp\\seo\\routes\\integrations_route' => 'Yoast\\WP\\SEO\\Routes\\Integrations_Route',
'yoast\\wp\\seo\\routes\\meta_search_route' => 'Yoast\\WP\\SEO\\Routes\\Meta_Search_Route',
@@ -414,7 +406,6 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\routes\\wincher_route' => 'Yoast\\WP\\SEO\\Routes\\Wincher_Route',
'yoast\\wp\\seo\\routes\\workouts_route' => 'Yoast\\WP\\SEO\\Routes\\Workouts_Route',
'yoast\\wp\\seo\\routes\\yoast_head_rest_field' => 'Yoast\\WP\\SEO\\Routes\\Yoast_Head_REST_Field',
'yoast\\wp\\seo\\schema_templates\\assets\\icons' => 'Yoast\\WP\\SEO\\Schema_Templates\\Assets\\Icons',
'yoast\\wp\\seo\\services\\health_check\\default_tagline_check' => 'Yoast\\WP\\SEO\\Services\\Health_Check\\Default_Tagline_Check',
'yoast\\wp\\seo\\services\\health_check\\default_tagline_reports' => 'Yoast\\WP\\SEO\\Services\\Health_Check\\Default_Tagline_Reports',
'yoast\\wp\\seo\\services\\health_check\\default_tagline_runner' => 'Yoast\\WP\\SEO\\Services\\Health_Check\\Default_Tagline_Runner',
@@ -482,7 +473,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Actions\\Importing\\Aioseo\\Aioseo_Validate_Data_Action' => 'getAioseoValidateDataActionService',
'Yoast\\WP\\SEO\\Actions\\Importing\\Deactivate_Conflicting_Plugins_Action' => 'getDeactivateConflictingPluginsActionService',
'Yoast\\WP\\SEO\\Actions\\Indexables\\Indexable_Head_Action' => 'getIndexableHeadActionService',
'Yoast\\WP\\SEO\\Actions\\Indexables_Page_Action' => 'getIndexablesPageActionService',
'Yoast\\WP\\SEO\\Actions\\Indexing\\Indexable_General_Indexation_Action' => 'getIndexableGeneralIndexationActionService',
'Yoast\\WP\\SEO\\Actions\\Indexing\\Indexable_Indexing_Complete_Action' => 'getIndexableIndexingCompleteActionService',
'Yoast\\WP\\SEO\\Actions\\Indexing\\Indexable_Post_Indexation_Action' => 'getIndexablePostIndexationActionService',
@@ -531,7 +521,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Conditionals\\Get_Request_Conditional' => 'getGetRequestConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Headless_Rest_Endpoints_Enabled_Conditional' => 'getHeadlessRestEndpointsEnabledConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Import_Tool_Selected_Conditional' => 'getImportToolSelectedConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Indexables_Page_Conditional' => 'getIndexablesPageConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Jetpack_Conditional' => 'getJetpackConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Migrations_Conditional' => 'getMigrationsConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\New_Settings_Ui_Conditional' => 'getNewSettingsUiConditionalService',
@@ -545,7 +534,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Conditionals\\Primary_Category_Conditional' => 'getPrimaryCategoryConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Robots_Txt_Conditional' => 'getRobotsTxtConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\SEMrush_Enabled_Conditional' => 'getSEMrushEnabledConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Schema_Blocks_Conditional' => 'getSchemaBlocksConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Settings_Conditional' => 'getSettingsConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Should_Index_Links_Conditional' => 'getShouldIndexLinksConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Text_Formality_Conditional' => 'getTextFormalityConditionalService',
@@ -651,7 +639,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Helpers\\Import_Helper' => 'getImportHelperService',
'Yoast\\WP\\SEO\\Helpers\\Indexable_Helper' => 'getIndexableHelperService',
'Yoast\\WP\\SEO\\Helpers\\Indexable_To_Postmeta_Helper' => 'getIndexableToPostmetaHelperService',
'Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper' => 'getIndexablesPageHelperService',
'Yoast\\WP\\SEO\\Helpers\\Indexing_Helper' => 'getIndexingHelperService',
'Yoast\\WP\\SEO\\Helpers\\Language_Helper' => 'getLanguageHelperService',
'Yoast\\WP\\SEO\\Helpers\\Meta_Helper' => 'getMetaHelperService',
@@ -712,7 +699,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Integrations\\Admin\\HelpScout_Beacon' => 'getHelpScoutBeaconService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Import_Integration' => 'getImportIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Indexables_Exclude_Taxonomy_Integration' => 'getIndexablesExcludeTaxonomyIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Indexables_Page_Integration' => 'getIndexablesPageIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Indexing_Notification_Integration' => 'getIndexingNotificationIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Indexing_Tool_Integration' => 'getIndexingToolIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Installation_Success_Integration' => 'getInstallationSuccessIntegrationService',
@@ -724,7 +710,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Integrations\\Admin\\Old_Premium_Integration' => 'getOldPremiumIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Redirect_Integration' => 'getRedirectIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Redirects_Page_Integration' => 'getRedirectsPageIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Social_Templates_Integration' => 'getSocialTemplatesIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Unsupported_PHP_Version_Notice' => 'getUnsupportedPHPVersionNoticeService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Workouts_Integration' => 'getWorkoutsIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Product_Editor_Checklist_Notification' => 'getBlackFridayProductEditorChecklistNotificationService',
@@ -761,7 +746,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Integrations\\Front_End\\WP_Robots_Integration' => 'getWPRobotsIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Front_End_Integration' => 'getFrontEndIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Primary_Category' => 'getPrimaryCategoryService',
'Yoast\\WP\\SEO\\Integrations\\Schema_Blocks' => 'getSchemaBlocksService',
'Yoast\\WP\\SEO\\Integrations\\Settings_Integration' => 'getSettingsIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Support_Integration' => 'getSupportIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Third_Party\\AMP' => 'getAMPService',
@@ -840,7 +824,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Routes\\First_Time_Configuration_Route' => 'getFirstTimeConfigurationRouteService',
'Yoast\\WP\\SEO\\Routes\\Importing_Route' => 'getImportingRouteService',
'Yoast\\WP\\SEO\\Routes\\Indexables_Head_Route' => 'getIndexablesHeadRouteService',
'Yoast\\WP\\SEO\\Routes\\Indexables_Page_Route' => 'getIndexablesPageRouteService',
'Yoast\\WP\\SEO\\Routes\\Indexing_Route' => 'getIndexingRouteService',
'Yoast\\WP\\SEO\\Routes\\Integrations_Route' => 'getIntegrationsRouteService',
'Yoast\\WP\\SEO\\Routes\\Meta_Search_Route' => 'getMetaSearchRouteService',
@@ -849,7 +832,6 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Routes\\Wincher_Route' => 'getWincherRouteService',
'Yoast\\WP\\SEO\\Routes\\Workouts_Route' => 'getWorkoutsRouteService',
'Yoast\\WP\\SEO\\Routes\\Yoast_Head_REST_Field' => 'getYoastHeadRESTFieldService',
'Yoast\\WP\\SEO\\Schema_Templates\\Assets\\Icons' => 'getIconsService',
'Yoast\\WP\\SEO\\Services\\Health_Check\\Default_Tagline_Check' => 'getDefaultTaglineCheckService',
'Yoast\\WP\\SEO\\Services\\Health_Check\\Default_Tagline_Reports' => 'getDefaultTaglineReportsService',
'Yoast\\WP\\SEO\\Services\\Health_Check\\Default_Tagline_Runner' => 'getDefaultTaglineRunnerService',
@@ -1238,20 +1220,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Actions\\Indexables\\Indexable_Head_Action'] = new \Yoast\WP\SEO\Actions\Indexables\Indexable_Head_Action(${($_ = isset($this->services['Yoast\\WP\\SEO\\Surfaces\\Meta_Surface']) ? $this->services['Yoast\\WP\\SEO\\Surfaces\\Meta_Surface'] : $this->getMetaSurfaceService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Actions\Indexables_Page_Action' shared autowired service.
*
* @return \Yoast\WP\SEO\Actions\Indexables_Page_Action
*
* @deprecated Yoast\WP\SEO\Actions\Indexables_Page_Action is deprecated since version 20.4!
*/
protected function getIndexablesPageActionService()
{
@trigger_error('Yoast\\WP\\SEO\\Actions\\Indexables_Page_Action is deprecated since version 20.4!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Actions\\Indexables_Page_Action'] = new \Yoast\WP\SEO\Actions\Indexables_Page_Action(${($_ = isset($this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Repository']) ? $this->services['Yoast\\WP\\SEO\\Repositories\\Indexable_Repository'] : $this->getIndexableRepositoryService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Post_Type_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Post_Type_Helper'] : $this->getPostTypeHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] = new \Yoast\WP\SEO\Helpers\Options_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper'] : $this->getIndexablesPageHelperService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Actions\Indexing\Indexable_General_Indexation_Action' shared autowired service.
*
@@ -1913,20 +1881,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Import_Tool_Selected_Conditional'] = new \Yoast\WP\SEO\Conditionals\Import_Tool_Selected_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Indexables_Page_Conditional' shared autowired service.
*
* @return \Yoast\WP\SEO\Conditionals\Indexables_Page_Conditional
*
* @deprecated Yoast\WP\SEO\Conditionals\Indexables_Page_Conditional is deprecated since version 20.4!
*/
protected function getIndexablesPageConditionalService()
{
@trigger_error('Yoast\\WP\\SEO\\Conditionals\\Indexables_Page_Conditional is deprecated since version 20.4!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Indexables_Page_Conditional'] = new \Yoast\WP\SEO\Conditionals\Indexables_Page_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Jetpack_Conditional' shared autowired service.
*
@@ -2057,20 +2011,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Conditionals\\SEMrush_Enabled_Conditional'] = new \Yoast\WP\SEO\Conditionals\SEMrush_Enabled_Conditional(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] = new \Yoast\WP\SEO\Helpers\Options_Helper())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional' shared autowired service.
*
* @return \Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional
*
* @deprecated Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional is deprecated since version 20.5!
*/
protected function getSchemaBlocksConditionalService()
{
@trigger_error('Yoast\\WP\\SEO\\Conditionals\\Schema_Blocks_Conditional is deprecated since version 20.5!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Schema_Blocks_Conditional'] = new \Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Settings_Conditional' shared autowired service.
*
@@ -3132,20 +3072,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Helpers\\Indexable_To_Postmeta_Helper'] = new \Yoast\WP\SEO\Helpers\Indexable_To_Postmeta_Helper(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Meta_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Meta_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Meta_Helper'] = new \Yoast\WP\SEO\Helpers\Meta_Helper())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Helpers\Indexables_Page_Helper' shared autowired service.
*
* @return \Yoast\WP\SEO\Helpers\Indexables_Page_Helper
*
* @deprecated Yoast\WP\SEO\Helpers\Indexables_Page_Helper is deprecated since version 20.4!
*/
protected function getIndexablesPageHelperService()
{
@trigger_error('Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper is deprecated since version 20.4!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper'] = new \Yoast\WP\SEO\Helpers\Indexables_Page_Helper(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] = new \Yoast\WP\SEO\Helpers\Options_Helper())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Helpers\Indexing_Helper' shared autowired service.
*
@@ -3767,20 +3693,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Integrations\\Admin\\Indexables_Exclude_Taxonomy_Integration'] = new \Yoast\WP\SEO\Integrations\Admin\Indexables_Exclude_Taxonomy_Integration(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] = new \Yoast\WP\SEO\Helpers\Options_Helper())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Admin\Indexables_Page_Integration' shared autowired service.
*
* @return \Yoast\WP\SEO\Integrations\Admin\Indexables_Page_Integration
*
* @deprecated Yoast\WP\SEO\Integrations\Admin\Indexables_Page_Integration is deprecated since version 20.4!
*/
protected function getIndexablesPageIntegrationService()
{
@trigger_error('Yoast\\WP\\SEO\\Integrations\\Admin\\Indexables_Page_Integration is deprecated since version 20.4!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Integrations\\Admin\\Indexables_Page_Integration'] = new \Yoast\WP\SEO\Integrations\Admin\Indexables_Page_Integration(${($_ = isset($this->services['WPSEO_Admin_Asset_Manager']) ? $this->services['WPSEO_Admin_Asset_Manager'] : $this->getWPSEOAdminAssetManagerService()) && false ?: '_'}, ${($_ = isset($this->services['WPSEO_Addon_Manager']) ? $this->services['WPSEO_Addon_Manager'] : $this->getWPSEOAddonManagerService()) && false ?: '_'}, ${($_ = isset($this->services['WPSEO_Shortlinker']) ? $this->services['WPSEO_Shortlinker'] : $this->getWPSEOShortlinkerService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Short_Link_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Short_Link_Helper'] : $this->getShortLinkHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper'] : $this->getIndexablesPageHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Options_Helper'] = new \Yoast\WP\SEO\Helpers\Options_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Product_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Product_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Product_Helper'] = new \Yoast\WP\SEO\Helpers\Product_Helper())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Admin\Indexing_Notification_Integration' shared autowired service.
*
@@ -3895,20 +3807,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Integrations\\Admin\\Redirects_Page_Integration'] = new \Yoast\WP\SEO\Integrations\Admin\Redirects_Page_Integration();
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Admin\Social_Templates_Integration' shared autowired service.
*
* @return \Yoast\WP\SEO\Integrations\Admin\Social_Templates_Integration
*
* @deprecated Yoast\WP\SEO\Integrations\Admin\Social_Templates_Integration is deprecated since version 20.3!
*/
protected function getSocialTemplatesIntegrationService()
{
@trigger_error('Yoast\\WP\\SEO\\Integrations\\Admin\\Social_Templates_Integration is deprecated since version 20.3!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Integrations\\Admin\\Social_Templates_Integration'] = new \Yoast\WP\SEO\Integrations\Admin\Social_Templates_Integration();
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Admin\Unsupported_PHP_Version_Notice' shared autowired service.
*
@@ -4271,20 +4169,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Integrations\\Primary_Category'] = new \Yoast\WP\SEO\Integrations\Primary_Category();
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Schema_Blocks' shared autowired service.
*
* @return \Yoast\WP\SEO\Integrations\Schema_Blocks
*
* @deprecated Yoast\WP\SEO\Integrations\Schema_Blocks is deprecated since version 20.5!
*/
protected function getSchemaBlocksService()
{
@trigger_error('Yoast\\WP\\SEO\\Integrations\\Schema_Blocks is deprecated since version 20.5!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Integrations\\Schema_Blocks'] = new \Yoast\WP\SEO\Integrations\Schema_Blocks(${($_ = isset($this->services['WPSEO_Admin_Asset_Manager']) ? $this->services['WPSEO_Admin_Asset_Manager'] : $this->getWPSEOAdminAssetManagerService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Conditionals\\Schema_Blocks_Conditional']) ? $this->services['Yoast\\WP\\SEO\\Conditionals\\Schema_Blocks_Conditional'] : $this->getSchemaBlocksConditionalService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Short_Link_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Short_Link_Helper'] : $this->getShortLinkHelperService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Settings_Integration' shared autowired service.
*
@@ -5305,20 +5189,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Routes\\Indexables_Head_Route'] = new \Yoast\WP\SEO\Routes\Indexables_Head_Route(${($_ = isset($this->services['Yoast\\WP\\SEO\\Actions\\Indexables\\Indexable_Head_Action']) ? $this->services['Yoast\\WP\\SEO\\Actions\\Indexables\\Indexable_Head_Action'] : $this->getIndexableHeadActionService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Routes\Indexables_Page_Route' shared autowired service.
*
* @return \Yoast\WP\SEO\Routes\Indexables_Page_Route
*
* @deprecated Yoast\WP\SEO\Routes\Indexables_Page_Route is deprecated since version 20.4!
*/
protected function getIndexablesPageRouteService()
{
@trigger_error('Yoast\\WP\\SEO\\Routes\\Indexables_Page_Route is deprecated since version 20.4!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Routes\\Indexables_Page_Route'] = new \Yoast\WP\SEO\Routes\Indexables_Page_Route(${($_ = isset($this->services['Yoast\\WP\\SEO\\Actions\\Indexables_Page_Action']) ? $this->services['Yoast\\WP\\SEO\\Actions\\Indexables_Page_Action'] : $this->getIndexablesPageActionService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Indexables_Page_Helper'] : $this->getIndexablesPageHelperService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Routes\Indexing_Route' shared autowired service.
*
@@ -5399,20 +5269,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Routes\\Yoast_Head_REST_Field'] = new \Yoast\WP\SEO\Routes\Yoast_Head_REST_Field(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Post_Type_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Post_Type_Helper'] : $this->getPostTypeHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Taxonomy_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Taxonomy_Helper'] : $this->getTaxonomyHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Post_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Post_Helper'] : $this->getPostHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Actions\\Indexables\\Indexable_Head_Action']) ? $this->services['Yoast\\WP\\SEO\\Actions\\Indexables\\Indexable_Head_Action'] : $this->getIndexableHeadActionService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Schema_Templates\Assets\Icons' shared autowired service.
*
* @return \Yoast\WP\SEO\Schema_Templates\Assets\Icons
*
* @deprecated Yoast\WP\SEO\Schema_Templates\Assets\Icons is deprecated since version 20.5!
*/
protected function getIconsService()
{
@trigger_error('Yoast\\WP\\SEO\\Schema_Templates\\Assets\\Icons is deprecated since version 20.5!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Schema_Templates\\Assets\\Icons'] = new \Yoast\WP\SEO\Schema_Templates\Assets\Icons();
}
/**
* Gets the public 'Yoast\WP\SEO\Services\Health_Check\Default_Tagline_Check' shared autowired service.
*

View File

@@ -327,34 +327,4 @@ class Social_Profiles_Helper {
return [ $twitter_setting ];
}
/* DEPRECATED METHODS */
/**
* Gets the person social profile fields supported by us after WP filtering.
*
* @deprecated 20.1
* @codeCoverageIgnore
*
* @return array The supported social profile fields.
*/
public function get_supported_person_social_profile_fields() {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.1' );
return [];
}
/**
* Checks if the current user has the capability to edit a specific user.
*
* @deprecated 20.2
* @codeCoverageIgnore
*
* @param int $person_id The id of the person to edit.
*
* @return bool
*/
public function can_edit_profile( $person_id ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.2' );
return \current_user_can( 'edit_user', $person_id );
}
}

View File

@@ -164,21 +164,6 @@ class Crawl_Settings_Integration implements Integration_Interface {
];
}
/**
* Adds content to the Crawl Cleanup tab.
*
* @deprecated 20.4
* @codeCoverageIgnore
*
* @param Yoast_Form $yform The yoast form object.
*
* @return void
*/
public function add_crawl_settings_tab_content( $yform ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.4' );
$this->add_crawl_settings( $yform );
}
/**
* Adds content to the Crawl Cleanup network tab.
*

View File

@@ -0,0 +1,78 @@
<?php
namespace Yoast\WP\SEO\Integrations\Blocks;
use Yoast\WP\SEO\Integrations\Integration_Interface;
/**
* Dynamic_Block class.
*/
abstract class Dynamic_Block_V3 implements Integration_Interface {
/**
* The name of the block.
*
* @var string
*/
protected $block_name;
/**
* The editor script for the block.
*
* @var string
*/
protected $script;
/**
* The base path for the block.
*
* @var string
*/
protected $base_path;
/**
* Returns the conditionals based on which this loadable should be active.
*
* @return array<string>
*/
public static function get_conditionals() {
return [];
}
/**
* Initializes the integration.
*
* Integrations hooking on `init` need to have a priority of 11 or higher to
* ensure that they run, as priority 10 is used by the loader to load the integrations.
*
* @return void
*/
public function register_hooks() {
\add_action( 'init', [ $this, 'register_block' ], 11 );
}
/**
* Registers the block.
*
* @return void
*/
public function register_block() {
\register_block_type(
$this->base_path . $this->block_name . '/block.json',
[
'editor_script' => $this->script,
'render_callback' => [ $this, 'present' ],
]
);
}
/**
* Presents the block output. This is abstract because in the loop we need to be able to build the data for the
* presenter in the last moment.
*
* @param array<string, bool|string|int|array> $attributes The block attributes.
*
* @return string The block output.
*/
abstract public function present( $attributes );
}

View File

@@ -12,7 +12,7 @@ use Yoast\WP\SEO\Surfaces\Helpers_Surface;
/**
* Siblings block class
*/
class Breadcrumbs_Block extends Dynamic_Block {
class Breadcrumbs_Block extends Dynamic_Block_V3 {
/**
* The name of the block.
@@ -84,12 +84,14 @@ class Breadcrumbs_Block extends Dynamic_Block {
$this->helpers = $helpers;
$this->indexable_repository = $indexable_repository;
$this->request_helper = $request_helper;
$this->base_path = \WPSEO_PATH . 'blocks/dynamic-blocks/';
}
/**
* Presents the breadcrumbs output for the current page or the available post_id.
*
* @param array $attributes The block attributes.
* @param array<string, bool|string|int|array> $attributes The block attributes.
*
* @return string The block output.
*/

View File

@@ -36,14 +36,6 @@ class First_Time_Configuration_Route implements Route_Interface {
*/
public const SOCIAL_PROFILES_ROUTE = '/social_profiles';
/**
* Represents a person's social profiles route.
*
* @deprecated 20.2
* @var string
*/
public const PERSON_SOCIAL_PROFILES_ROUTE = '/person_social_profiles';
/**
* Represents a route to enable/disable tracking.
*
@@ -319,48 +311,4 @@ class First_Time_Configuration_Route implements Route_Interface {
return new WP_REST_Response( $data, $data->status );
}
/* DEPRECATED METHODS */
/**
* Gets a person's social profiles values.
*
* @deprecated 20.2
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request.
*
* @return WP_REST_Response
*/
public function get_person_social_profiles( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.2' );
$data = $this
->first_time_configuration_action
->get_person_social_profiles( $request->get_param( 'user_id' ) );
return new WP_REST_Response( $data, $data->status );
}
/**
* Sets a person's social profiles values.
*
* @deprecated 20.2
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request.
*
* @return WP_REST_Response
*/
public function set_person_social_profiles( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 20.2' );
$data = $this
->first_time_configuration_action
->set_person_social_profiles( $request->get_json_params() );
return new WP_REST_Response(
[ 'json' => $data ]
);
}
}