Merged in feature/MAW-855-import-code-into-aws (pull request #2)

code import from pantheon

* code import from pantheon
This commit is contained in:
Tony Volpe
2023-12-04 23:08:14 +00:00
parent 8c9b1312bc
commit 8f4b5efda6
4766 changed files with 185592 additions and 239967 deletions

View File

@@ -58,19 +58,13 @@ class First_Time_Configuration_Action {
* @return object The response object.
*/
public function set_site_representation( $params ) {
$failures = [];
$failures = [];
$old_values = $this->get_old_values( self::SITE_REPRESENTATION_FIELDS );
foreach ( self::SITE_REPRESENTATION_FIELDS as $field_name ) {
if ( isset( $params[ $field_name ] ) ) {
if ( $field_name === 'description' && \current_user_can( 'manage_options' ) ) {
$result = \update_option( 'blogdescription', $params['description'] );
if ( ! $result && $params['description'] === \get_option( 'blogdescription' ) ) {
$result = true;
}
}
else {
$result = $this->options_helper->set( $field_name, $params[ $field_name ] );
}
$result = $this->options_helper->set( $field_name, $params[ $field_name ] );
if ( ! $result ) {
$failures[] = $field_name;
}
@@ -81,6 +75,17 @@ class First_Time_Configuration_Action {
$this->options_helper->set( 'company_logo_meta', false );
$this->options_helper->set( 'person_logo_meta', false );
/**
* Action: 'wpseo_post_update_site_representation' - Allows for Hiive event tracking.
*
* @param array The new values of the options.
* @param array The old values of the options.
* @param array The options that failed to be saved.
*
* @internal
*/
\do_action( 'wpseo_ftc_post_update_site_representation', $params, $old_values, $failures );
if ( \count( $failures ) === 0 ) {
return (object) [
'success' => true,
@@ -104,7 +109,19 @@ class First_Time_Configuration_Action {
* @return object The response object.
*/
public function set_social_profiles( $params ) {
$failures = $this->social_profiles_helper->set_organization_social_profiles( $params );
$old_values = $this->get_old_values( \array_keys( $this->social_profiles_helper->get_organization_social_profile_fields() ) );
$failures = $this->social_profiles_helper->set_organization_social_profiles( $params );
/**
* Action: 'wpseo_post_update_social_profiles' - Allows for Hiive event tracking.
*
* @param array The new values of the options.
* @param array The old values of the options.
* @param array The options that failed to be saved.
*
* @internal
*/
\do_action( 'wpseo_ftc_post_update_social_profiles', $params, $old_values, $failures );
if ( empty( $failures ) ) {
return (object) [
@@ -186,6 +203,18 @@ class First_Time_Configuration_Action {
$success = $this->options_helper->set( 'tracking', $params['tracking'] );
}
/**
* Action: 'wpseo_post_update_enable_tracking' - Allows for Hiive event tracking.
*
* @param array The new value.
* @param array The old value.
* @param bool Whether the option failed to be stored.
*
* @internal
*/
// $success is negated to be aligned with the other two actions which pass $failures.
\do_action( 'wpseo_ftc_post_update_enable_tracking', $params['tracking'], $option_value, ! $success );
if ( $success ) {
return (object) [
'success' => true,
@@ -295,4 +324,21 @@ class First_Time_Configuration_Action {
private function can_edit_profile( $person_id ) {
return \current_user_can( 'edit_user', $person_id );
}
/**
* Gets the old values for the given fields.
*
* @param array $fields_names The fields to get the old values for.
*
* @return array The old values.
*/
private function get_old_values( array $fields_names ) : array {
$old_values = [];
foreach ( $fields_names as $field_name ) {
$old_values[ $field_name ] = $this->options_helper->get( $field_name );
}
return $old_values;
}
}

View File

@@ -43,7 +43,7 @@ class To_Be_Cleaned_Indexables_Collector implements WPSEO_Collection {
'indexables_for_non_publicly_viewable_post_type_archive_pages' => $this->indexable_cleanup_repository->count_indexables_for_non_publicly_post_type_archive_pages(),
'indexables_for_authors_archive_disabled' => $this->indexable_cleanup_repository->count_indexables_for_authors_archive_disabled(),
'indexables_for_authors_without_archive' => $this->indexable_cleanup_repository->count_indexables_for_authors_without_archive(),
'indexables_for_object_type_and_source_table_users' => $this->indexable_cleanup_repository->count_indexables_for_object_type_and_source_table( 'users', 'ID', 'user' ),
'indexables_for_object_type_and_source_table_users' => $this->indexable_cleanup_repository->count_indexables_for_orphaned_users(),
'indexables_for_object_type_and_source_table_posts' => $this->indexable_cleanup_repository->count_indexables_for_object_type_and_source_table( 'posts', 'ID', 'post' ),
'indexables_for_object_type_and_source_table_terms' => $this->indexable_cleanup_repository->count_indexables_for_object_type_and_source_table( 'terms', 'term_id', 'term' ),
'orphaned_from_table_indexable_hierarchy' => $this->indexable_cleanup_repository->count_orphaned_from_table( 'Indexable_Hierarchy', 'indexable_id' ),

View File

@@ -5,6 +5,7 @@ namespace Yoast\WP\SEO\Builders;
use wpdb;
use Yoast\WP\SEO\Exceptions\Indexable\Author_Not_Built_Exception;
use Yoast\WP\SEO\Helpers\Author_Archive_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Post_Helper;
use Yoast\WP\SEO\Models\Indexable;
use Yoast\WP\SEO\Values\Indexables\Indexable_Builder_Versions;
@@ -32,6 +33,13 @@ class Indexable_Author_Builder {
*/
protected $version;
/**
* Holds the options helper instance.
*
* @var Options_Helper
*/
protected $options_helper;
/**
* Holds the taxonomy helper instance.
*
@@ -51,17 +59,20 @@ class Indexable_Author_Builder {
*
* @param Author_Archive_Helper $author_archive The author archive helper.
* @param Indexable_Builder_Versions $versions The Indexable version manager.
* @param Options_Helper $options_helper The options helper.
* @param Post_Helper $post_helper The post helper.
* @param wpdb $wpdb The WPDB instance.
*/
public function __construct(
Author_Archive_Helper $author_archive,
Indexable_Builder_Versions $versions,
Options_Helper $options_helper,
Post_Helper $post_helper,
wpdb $wpdb
) {
$this->author_archive = $author_archive;
$this->version = $versions->get_latest_version_for_type( 'user' );
$this->options_helper = $options_helper;
$this->post_helper = $post_helper;
$this->wpdb = $wpdb;
}
@@ -215,7 +226,8 @@ class Indexable_Author_Builder {
}
// We will check if the author has public posts the WP way, instead of the indexable way, to make sure we get proper results even if SEO optimization is not run.
if ( $this->author_archive->author_has_public_posts_wp( $user_id ) === false ) {
// In case the user has no public posts, we check if the user should be indexed anyway.
if ( $this->options_helper->get( 'noindex-author-noposts-wpseo', false ) === true && $this->author_archive->author_has_public_posts_wp( $user_id ) === false ) {
$exception = Author_Not_Built_Exception::author_archives_are_not_indexed_for_users_without_posts( $user_id );
}

View File

@@ -2,6 +2,8 @@
namespace Yoast\WP\SEO\Builders;
use DOMDocument;
use WP_HTML_Tag_Processor;
use WPSEO_Image_Utils;
use Yoast\WP\SEO\Helpers\Image_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
@@ -211,14 +213,146 @@ class Indexable_Link_Builder {
return $links;
}
/**
* Gathers all images from content with WP's WP_HTML_Tag_Processor() and returns them along with their IDs, if possible.
*
* @param string $content The content.
*
* @return int[] An associated array of image IDs, keyed by their URL.
*/
protected function gather_images_wp( $content ) {
$processor = new WP_HTML_Tag_Processor( $content );
$images = [];
$query = [
'tag_name' => 'img',
];
/**
* Filter 'wpseo_image_attribute_containing_id' - Allows filtering what attribute will be used to extract image IDs from.
*
* Defaults to "class", which is where WP natively stores the image IDs, in a `wp-image-<ID>` format.
*
* @api string The attribute to be used to extract image IDs from.
*/
$attribute = \apply_filters( 'wpseo_image_attribute_containing_id', 'class' );
while ( $processor->next_tag( $query ) ) {
$src = \htmlentities( $processor->get_attribute( 'src' ), ( ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 ), \get_bloginfo( 'charset' ) );
$classes = $processor->get_attribute( $attribute );
$id = $this->extract_id_of_classes( $classes );
$images[ $src ] = $id;
}
return $images;
}
/**
* Gathers all images from content with DOMDocument() and returns them along with their IDs, if possible.
*
* @param string $content The content.
*
* @return int[] An associated array of image IDs, keyed by their URL.
*/
protected function gather_images_domdocument( $content ) {
$images = [];
$charset = \get_bloginfo( 'charset' );
/**
* Filter 'wpseo_image_attribute_containing_id' - Allows filtering what attribute will be used to extract image IDs from.
*
* Defaults to "class", which is where WP natively stores the image IDs, in a `wp-image-<ID>` format.
*
* @api string The attribute to be used to extract image IDs from.
*/
$attribute = \apply_filters( 'wpseo_image_attribute_containing_id', 'class' );
libxml_use_internal_errors( true );
$post_dom = new DOMDocument();
$post_dom->loadHTML( '<?xml encoding="' . $charset . '">' . $content );
libxml_clear_errors();
foreach ( $post_dom->getElementsByTagName( 'img' ) as $img ) {
$src = \htmlentities( $img->getAttribute( 'src' ), ( ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 ), $charset );
$classes = $img->getAttribute( $attribute );
$id = $this->extract_id_of_classes( $classes );
$images[ $src ] = $id;
}
return $images;
}
/**
* Extracts image ID out of the image's classes.
*
* @param string $classes The classes assigned to the image.
*
* @return int The ID that's extracted from the classes.
*/
protected function extract_id_of_classes( $classes ) {
if ( ! $classes ) {
return 0;
}
/**
* Filter 'wpseo_extract_id_pattern' - Allows filtering the regex patern to be used to extract image IDs from class/attribute names.
*
* Defaults to the pattern that extracts image IDs from core's `wp-image-<ID>` native format in image classes.
*
* @api string The regex pattern to be used to extract image IDs from class names. Empty string if the whole class/attribute should be returned.
*/
$pattern = \apply_filters( 'wpseo_extract_id_pattern', '/(?<!\S)wp-image-(\d+)(?!\S)/i' );
if ( $pattern === '' ) {
return (int) $classes;
}
$matches = [];
if ( preg_match( $pattern, $classes, $matches ) ) {
return (int) $matches[1];
}
return 0;
}
/**
* Gathers all images from content.
*
* @param string $content The content.
*
* @return string[] An array of urls.
* @return int[] An associated array of image IDs, keyed by their URLs.
*/
protected function gather_images( $content ) {
/**
* Filter 'wpseo_force_creating_and_using_attachment_indexables' - Filters if we should use attachment indexables to find all content images. Instead of scanning the content.
*
* The default value is false.
*
* @since 21.1
*/
$should_not_parse_content = \apply_filters( 'wpseo_force_creating_and_using_attachment_indexables', false );
/**
* Filter 'wpseo_force_skip_image_content_parsing' - Filters if we should force skip scanning the content to parse images.
* This filter can be used if the regex gives a faster result than scanning the code.
*
* The default value is false.
*
* @since 21.1
*/
$should_not_parse_content = \apply_filters( 'wpseo_force_skip_image_content_parsing', $should_not_parse_content );
if ( ! $should_not_parse_content && class_exists( WP_HTML_Tag_Processor::class ) ) {
return $this->gather_images_wp( $content );
}
if ( ! $should_not_parse_content && class_exists( DOMDocument::class ) ) {
return $this->gather_images_DOMDocument( $content );
}
if ( \strpos( $content, 'src' ) === false ) {
// Nothing to do.
return [];
@@ -229,7 +363,7 @@ class Indexable_Link_Builder {
// Used modifiers iU to match case insensitive and make greedy quantifiers lazy.
if ( \preg_match_all( "/$regexp/iU", $content, $matches, \PREG_SET_ORDER ) ) {
foreach ( $matches as $match ) {
$images[] = \trim( $match[2], "'" );
$images[ $match[2] ] = 0;
}
}
@@ -241,7 +375,7 @@ class Indexable_Link_Builder {
*
* @param Indexable $indexable The indexable.
* @param string[] $links The link URLs.
* @param string[] $images The image sources.
* @param int[] $images The image sources.
*
* @return SEO_Links[] The link models.
*/
@@ -262,13 +396,12 @@ class Indexable_Link_Builder {
}
);
$images = \array_map(
function( $link ) use ( $home_url, $indexable ) {
return $this->create_internal_link( $link, $home_url, $indexable, true );
},
$images
);
return \array_merge( $links, $images );
$image_links = [];
foreach ( $images as $image_url => $image_id ) {
$image_links[] = $this->create_internal_link( $image_url, $home_url, $indexable, true, $image_id );
}
return \array_merge( $links, $image_links );
}
/**
@@ -294,10 +427,11 @@ class Indexable_Link_Builder {
* @param array $home_url The home url, as parsed by wp_parse_url.
* @param Indexable $indexable The indexable of the post containing the link.
* @param bool $is_image Whether or not the link is an image.
* @param int $image_id The ID of the internal image.
*
* @return SEO_Links The created link.
*/
protected function create_internal_link( $url, $home_url, $indexable, $is_image = false ) {
protected function create_internal_link( $url, $home_url, $indexable, $is_image = false, $image_id = 0 ) {
$parsed_url = \wp_parse_url( $url );
$link_type = $this->url_helper->get_link_type( $parsed_url, $home_url, $is_image );
@@ -326,11 +460,12 @@ class Indexable_Link_Builder {
if ( $model->type === SEO_Links::TYPE_INTERNAL_IMAGE ) {
$permalink = $this->build_permalink( $url, $home_url );
if ( ! $this->options_helper->get( 'disable-attachment' ) ) {
/** The `wpseo_force_creating_and_using_attachment_indexables` filter is documented in indexable-link-builder.php */
if ( ! $this->options_helper->get( 'disable-attachment' ) || \apply_filters( 'wpseo_force_creating_and_using_attachment_indexables', false ) ) {
$model = $this->enhance_link_from_indexable( $model, $permalink );
}
else {
$target_post_id = WPSEO_Image_Utils::get_attachment_by_url( $permalink );
$target_post_id = ( $image_id !== 0 ) ? $image_id : WPSEO_Image_Utils::get_attachment_by_url( $permalink );
if ( ! empty( $target_post_id ) ) {
$model->target_post_id = $target_post_id;

View File

@@ -0,0 +1,41 @@
<?php // phpcs:ignore Yoast.Files.FileName.InvalidClassFileName -- Reason: this explicitly concerns the Yoast admin.
namespace Yoast\WP\SEO\Conditionals\Admin;
use Yoast\WP\SEO\Conditionals\Conditional;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
/**
* Conditional that is only met when on a Yoast SEO admin page.
*/
class Yoast_Admin_Conditional implements Conditional {
/**
* Holds the Current_Page_Helper.
*
* @var Current_Page_Helper
*/
private $current_page_helper;
/**
* Constructs the conditional.
*
* @param \Yoast\WP\SEO\Helpers\Current_Page_Helper $current_page_helper The current page helper.
*/
public function __construct( Current_Page_Helper $current_page_helper ) {
$this->current_page_helper = $current_page_helper;
}
/**
* Returns `true` when on the admin dashboard, update or Yoast SEO pages.
*
* @return bool `true` when on the admin dashboard, update or Yoast SEO pages.
*/
public function is_met() {
if ( ! \is_admin() ) {
return false;
}
return $this->current_page_helper->is_yoast_seo_page();
}
}

View File

@@ -0,0 +1,24 @@
<?php // phpcs:ignore Yoast.Files.FileName.InvalidClassFileName -- Reason: this explicitly concerns the Yoast tools page.
namespace Yoast\WP\SEO\Conditionals;
/**
* Conditional that is only met when current page is the tools page.
*/
class User_Profile_Conditional implements Conditional {
/**
* Returns whether or not this conditional is met.
*
* @return bool Whether or not the conditional is met.
*/
public function is_met() {
global $pagenow;
if ( $pagenow !== 'profile.php' ) {
return false;
}
return true;
}
}

View File

@@ -42,7 +42,7 @@ class Content_Type_Visibility_Dismiss_Notifications {
$success = $this->options->set( 'new_post_types', $new_needs_review );
$message = ( $success ) ? __( 'Post type is no longer new.', 'wordpress-seo' ) : __( 'Error: Post type was not removed from new_post_types list.', 'wordpress-seo' );
if ( $success ) {
$this->maybe_dismiss_notifications();
$this->maybe_dismiss_notifications( [ 'new_post_types' => $new_needs_review ] );
}
}
@@ -72,7 +72,7 @@ class Content_Type_Visibility_Dismiss_Notifications {
$success = $this->options->set( 'new_taxonomies', $new_needs_review );
$message = ( $success ) ? __( 'Taxonomy is no longer new.', 'wordpress-seo' ) : __( 'Error: Taxonomy was not removed from new_taxonomies list.', 'wordpress-seo' );
if ( $success ) {
$this->maybe_dismiss_notifications();
$this->maybe_dismiss_notifications( [ 'new_taxonomies' => $new_needs_review ] );
}
}
@@ -88,11 +88,14 @@ class Content_Type_Visibility_Dismiss_Notifications {
/**
* Checks if there are new content types or taxonomies.
*
* @param array $new_content_types The new content types.
* @return bool
*/
public function maybe_dismiss_notifications() {
$taxonomies_needs_review = $this->options->get( 'new_taxonomies', [] );
$post_types_needs_review = $this->options->get( 'new_post_types', [] );
public function maybe_dismiss_notifications( $new_content_types = [] ) {
$post_types_needs_review = ( array_key_exists( 'new_post_types', $new_content_types ) ) ? $new_content_types['new_post_types'] : $this->options->get( 'new_post_types', [] );
$taxonomies_needs_review = ( array_key_exists( 'new_taxonomies', $new_content_types ) ) ? $new_content_types['new_taxonomies'] : $this->options->get( 'new_taxonomies', [] );
if ( $post_types_needs_review || $taxonomies_needs_review ) {
return;
}

View File

@@ -103,7 +103,7 @@ class Content_Type_Visibility_Watcher_Actions implements Integration_Interface {
$new_needs_review = \array_diff( $needs_review, $newly_made_non_public_post_types );
if ( \count( $new_needs_review ) !== \count( $needs_review ) ) {
$this->options->set( 'new_post_types', $new_needs_review );
$this->content_type_dismiss_notifications->maybe_dismiss_notifications();
$this->content_type_dismiss_notifications->maybe_dismiss_notifications( [ 'new_post_types' => $new_needs_review ] );
}
}
@@ -131,7 +131,7 @@ class Content_Type_Visibility_Watcher_Actions implements Integration_Interface {
$new_needs_review = \array_diff( $needs_review, $newly_made_non_public_taxonomies );
if ( \count( $new_needs_review ) !== \count( $needs_review ) ) {
$this->options->set( 'new_taxonomies', $new_needs_review );
$this->content_type_dismiss_notifications->maybe_dismiss_notifications();
$this->content_type_dismiss_notifications->maybe_dismiss_notifications( [ 'new_taxonomies' => $new_needs_review ] );
}
}

View File

@@ -1,169 +0,0 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* This class handles the data for the option where the Ryte data is stored.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
class WPSEO_Ryte_Option {
/**
* Indicates the data is not fetched.
*
* @deprecated 19.6
* @var int
*/
const NOT_FETCHED = 0;
/**
* Indicates the option is indexable.
*
* @deprecated 19.6
* @var int
*/
const IS_INDEXABLE = 0;
/**
* Indicates the option is not indexable.
*
* @deprecated 19.6
* @var int
*/
const IS_NOT_INDEXABLE = 0;
/**
* Indicates the data could not be fetched.
*
* @deprecated 19.6
* @var int
*/
const CANNOT_FETCH = -1;
/**
* The name of the option where data will be stored.
*
* @deprecated 19.6
* @var string
*/
const OPTION_NAME = '';
/**
* The key of the status in the option.
*
* @deprecated 19.6
* @var string
*/
const STATUS = '';
/**
* The key of the last fetch date in the option.
*
* @deprecated 19.6
* @var string
*/
const LAST_FETCH = '';
/**
* The limit for fetching the status manually.
*
* @deprecated 19.6
* @var int
*/
const FETCH_LIMIT = 0;
/**
* Setting the object by setting the properties.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Getting the status from the option.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return int|string
*/
public function get_status() {
_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return -1;
}
/**
* Saving the status to the options.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param string $status The status to save.
*/
public function set_status( $status ) {
_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Saving the last fetch timestamp to the options.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param int $timestamp Timestamp with the new value.
*/
public function set_last_fetch( $timestamp ) {
_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Determines whether the indexability status should be fetched.
*
* If LAST_FETCH isn't set, we assume the indexability status hasn't been fetched
* yet and return true. Then, we check whether the last fetch is within the
* FETCH_LIMIT time interval (15 seconds) to avoid too many consecutive API calls.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return bool Whether the indexability status should be fetched.
*/
public function should_be_fetched() {
_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return false;
}
/**
* Saving the option with the current data.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
public function save_option() {
_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Returns the value of the onpage_enabled status.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return bool
*/
public function is_enabled() {
_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return false;
}
}

View File

@@ -1,34 +0,0 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* This class will fetch a new status from Ryte and if it's necessary it will
* notify the site admin by email and remove the current meta value to hide the
* notice for all admin users.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
class WPSEO_Ryte_Request {
/**
* Sends a request to the Ryte API to check whether a URL is indexable.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param string $target_url The URL to check indexability for.
* @param array $parameters Array of extra parameters to send to the Ryte API.
*
* @return array
*/
public function do_request( $target_url, $parameters = [] ) {
_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
}

View File

@@ -1,284 +0,0 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Handles the request for getting the Ryte status.
*
* @deprecated 18.5
*/
class WPSEO_Ryte implements WPSEO_WordPress_Integration {
/**
* Is the request started by pressing the fetch button.
*
* @var bool
*/
private $is_manual_request = false;
/**
* Holds the Ryte API response.
*
* @var array
*/
private $ryte_response = null;
/**
* Constructs the object.
*
* @deprecated 18.5
* @codeCoverageIgnore
*/
public function __construct() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
$this->maybe_add_weekly_schedule();
}
/**
* Sets up the hooks.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return void
*/
public function register_hooks() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
if ( ! self::is_active() ) {
return;
}
// Sets the action for the Ryte fetch cron job.
add_action( 'wpseo_ryte_fetch', [ $this, 'fetch_from_ryte' ] );
}
/**
* Determines if we can use the functionality.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return bool True if this functionality can be used.
*/
public static function is_active() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
if ( wp_doing_ajax() ) {
return false;
}
if ( ! WPSEO_Options::get( 'ryte_indexability' ) ) {
return false;
}
return true;
}
/**
* Hooks to run on plugin activation.
*
* @deprecated 18.5
* @codeCoverageIgnore
*/
public function activate_hooks() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
if ( $this->get_option()->is_enabled() ) {
$this->schedule_cron();
return;
}
$this->unschedule_cron();
}
/**
* Determines whether to add a custom cron weekly schedule.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return void
*/
public function maybe_add_weekly_schedule() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
// If there's no default cron weekly schedule, add a custom one.
add_filter( 'cron_schedules', [ $this, 'add_weekly_schedule' ] );
}
/**
* Adds a custom weekly cron schedule.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @param array $schedules The existing custom cron schedules.
*
* @return array Enriched list of custom cron schedules.
*/
public function add_weekly_schedule( $schedules ) {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
if ( ! is_array( $schedules ) ) {
$schedules = [];
}
/*
* Starting with version 5.4, WordPress does have a default weekly cron
* schedule. See https://core.trac.wordpress.org/changeset/47062.
* We need to add a custom one only if the default one doesn't exist.
*/
if ( isset( $schedules['weekly'] ) ) {
return $schedules;
}
$schedules['weekly'] = [
'interval' => WEEK_IN_SECONDS,
'display' => __( 'Once Weekly', 'wordpress-seo' ),
];
return $schedules;
}
/**
* Fetches the data from Ryte.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return bool|null Whether the request ran.
*/
public function fetch_from_ryte() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
// Don't do anything when the WordPress environment type isn't "production".
if ( wp_get_environment_type() !== 'production' ) {
return;
}
$ryte_option = $this->get_option();
if ( ! $ryte_option->should_be_fetched() ) {
return false;
}
$new_status = $this->request_indexability();
// Updates the timestamp in the option.
$ryte_option->set_last_fetch( time() );
$ryte_option->set_status( $new_status );
$ryte_option->save_option();
return true;
}
/**
* Retrieves the option to use.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return WPSEO_Ryte_Option The option.
*/
protected function get_option() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
return new WPSEO_Ryte_Option();
}
/**
* Sends a request to Ryte to get the indexability status.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return int The indexability status value.
*/
protected function request_indexability() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
$parameters = [];
if ( $this->wordfence_protection_enabled() ) {
$parameters['wf_strict'] = 1;
}
$request = new WPSEO_Ryte_Request();
$response = $request->do_request( get_option( 'home' ), $parameters );
// Populate the ryte_response property.
$this->ryte_response = $response;
// It's a valid Ryte response because the array contains an `is_indexable` element.
if ( isset( $response['is_indexable'] ) ) {
return (int) $response['is_indexable'];
}
// It's not a valid Ryte response.
return WPSEO_Ryte_Option::CANNOT_FETCH;
}
/**
* Schedules the cronjob to get the new indexability status.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return void
*/
private function schedule_cron() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
if ( wp_next_scheduled( 'wpseo_ryte_fetch' ) ) {
return;
}
wp_schedule_event( time(), 'weekly', 'wpseo_ryte_fetch' );
}
/**
* Unschedules the cronjob to get the new indexability status.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return void
*/
private function unschedule_cron() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
if ( ! wp_next_scheduled( 'wpseo_ryte_fetch' ) ) {
return;
}
wp_clear_scheduled_hook( 'wpseo_ryte_fetch' );
}
/**
* Checks if WordFence protects the site against 'fake' Google crawlers.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return bool True if WordFence protects the site.
*/
private function wordfence_protection_enabled() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
if ( ! class_exists( 'wfConfig' ) ) {
return false;
}
if ( ! method_exists( 'wfConfig', 'get' ) ) {
return false;
}
return (bool) wfConfig::get( 'blockFakeBots' );
}
/**
* Retrieves the Ryte API response property.
*
* @deprecated 18.5
* @codeCoverageIgnore
*
* @return array|WP_Error The response or WP_Error on failure.
*/
public function get_response() {
_deprecated_function( __METHOD__, 'Yoast SEO 18.5' );
return $this->ryte_response;
}
}

View File

@@ -1,11 +0,0 @@
<?php
namespace Yoast\WP\SEO\Actions\Configuration;
/**
* Class Configuration_Workout_Action.
*
* @deprecated 19.0 - Use \Yoast\WP\SEO\Actions\First_Time_Configuration_Action instead.
* @codeCoverageIgnore
*/
class Configuration_Workout_Action extends First_Time_Configuration_Action {}

View File

@@ -1,23 +0,0 @@
<?php
namespace Yoast\WP\SEO\Conditionals;
/**
* Feature flag conditional for the front-end inspector.
*
* @deprecated 19.5
*/
class Front_End_Inspector_Conditional extends Feature_Flag_Conditional {
/**
* Returns the name of the feature flag.
*
* @deprecated 19.5
*
* @return string The name of the feature flag.
*/
protected function get_feature_flag() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.5' );
return 'FRONT_END_INSPECTOR';
}
}

View File

@@ -1,26 +0,0 @@
<?php
namespace Yoast\WP\SEO\Conditionals;
/**
* Checks if the YOAST_SEO_JAPANESE_SUPPORT constant is set.
*
* @deprecated 17.9
* @codeCoverageIgnore
*/
class Japanese_Support_Conditional extends Feature_Flag_Conditional {
/**
* Returns the name of the feature flag.
* 'YOAST_SEO_' is automatically prepended to it and it will be uppercased.
*
* @deprecated 17.9
* @codeCoverageIgnore
*
* @return string the name of the feature flag.
*/
public function get_feature_flag() {
\_deprecated_function( __METHOD__, 'Yoast SEO 17.9' );
return 'JAPANESE_SUPPORT';
}
}

View File

@@ -1,163 +0,0 @@
<?php
namespace Yoast\WP\SEO\Integrations\Admin;
use WPSEO_Ryte_Option;
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;
/**
* Handles the request for getting the Ryte status.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
class Ryte_Integration implements Integration_Interface {
/**
* Constructor.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param Options_Helper $options_helper The options helper object used to determine if Ryte is active or not.
*/
public function __construct( Options_Helper $options_helper ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Sets up the hooks.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return void
*/
public function register_hooks() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Returns the conditionals based on which this loadable should be active.
*
* In this case: only when on an admin page.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return array The conditionals.
*/
public static function get_conditionals() {
return [ Admin_Conditional::class ];
}
/**
* Determines if we can use the functionality.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return bool True if this functionality can be used.
*/
public function is_active() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return false;
}
/**
* Hooks to run on plugin activation.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
public function activate_hooks() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Determines whether to add a custom cron weekly schedule.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return void
*/
public function maybe_add_weekly_schedule() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Adds a custom weekly cron schedule.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param array $schedules The existing custom cron schedules.
*
* @return array Enriched list of custom cron schedules.
*/
public function add_weekly_schedule( $schedules ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
/**
* Fetches the data from Ryte.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return bool Whether the request ran.
*/
public function fetch_from_ryte() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return true;
}
/**
* Retrieves the option to use.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return WPSEO_Ryte_Option The option.
*/
public function get_option() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return new WPSEO_Ryte_Option();
}
/**
* Sends a request to Ryte to get the indexability status.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return int The indexability status value.
*/
protected function request_indexability() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return -1;
}
/**
* Retrieves the Ryte API response property.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return array The response or WP_Error on failure.
*/
public function get_response() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
}

View File

@@ -1,42 +0,0 @@
<?php
namespace Yoast\WP\SEO\Presenters\Admin;
use Yoast\WP\SEO\Presenters\Abstract_Presenter;
/**
* Class Auto_Update_Notification_Presenter.
*
* @deprecated 19.8
* @codeCoverageIgnore
*/
class Auto_Update_Notification_Presenter extends Abstract_Presenter {
/**
* Returns the notification as an HTML string.
*
* @deprecated 19.8
* @codeCoverageIgnore
*
* @return string The notification in an HTML string representation.
*/
public function present() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.8' );
return '';
}
/**
* Returns the message to show.
*
* @deprecated 19.8
* @codeCoverageIgnore
*
* @return string The message.
*/
protected function get_message() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.8' );
return '';
}
}

View File

@@ -1,188 +0,0 @@
<?php
namespace Yoast\WP\SEO\Routes;
use WP_REST_Request;
use Yoast\WP\SEO\Actions\Configuration\Configuration_Workout_Action;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
/**
* Configuration_Workout_Route class.
*
* @deprecated 19.0 - Use \Yoast\WP\SEO\Actions\First_Time_Configuration_Action instead.
* @codeCoverageIgnore
*/
class Configuration_Workout_Route implements Route_Interface {
use No_Conditionals;
/**
* Represents a site representation route.
*
* @var string
*/
const SITE_REPRESENTATION_ROUTE = '/site_representation';
/**
* Represents a social profiles route.
*
* @var string
*/
const SOCIAL_PROFILES_ROUTE = '/social_profiles';
/**
* Represents a person's social profiles route.
*
* @var string
*/
const PERSON_SOCIAL_PROFILES_ROUTE = '/person_social_profiles';
/**
* Represents a route to enable/disable tracking.
*
* @var string
*/
const ENABLE_TRACKING_ROUTE = '/enable_tracking';
/**
* Represents a route to check if current user has the correct capabilities to edit another user's profile.
*
* @var string
*/
const CHECK_CAPABILITY_ROUTE = '/check_capability';
/**
* Configuration_Workout_Route constructor.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @param Configuration_Workout_Action $configuration_workout_action The configuration workout action.
*/
public function __construct(
Configuration_Workout_Action $configuration_workout_action
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0' );
}
/**
* Registers routes with WordPress.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @return void
*/
public function register_routes() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::register_routes' );
}
/**
* Sets the site representation values.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request.
*
* @return void
*/
public function set_site_representation( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::set_site_representation' );
}
/**
* Sets the social profiles values.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request.
*
* @return void
*/
public function set_social_profiles( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::set_social_profiles' );
}
/**
* Gets a person's social profiles values.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request.
*
* @return void
*/
public function get_person_social_profiles( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::get_person_social_profiles' );
}
/**
* Sets a person's social profiles values.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request.
*
* @return void
*/
public function set_person_social_profiles( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::set_person_social_profiles' );
}
/**
* Checks if the current user has the correct capability to edit a specific user.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request.
*
* @return void
*/
public function check_capability( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::check_capability' );
}
/**
* Enables or disables tracking.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @param WP_REST_Request $request The request.
*
* @return void
*/
public function set_enable_tracking( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::set_enable_tracking' );
}
/**
* Checks if the current user has the right capability.
*
* @deprecated 19.0
* @codeCoverageIgnore
*
* @return bool
*/
public function can_manage_options() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::can_manage_options' );
return \current_user_can( 'wpseo_manage_options' );
}
/**
* Checks if the current user has the capability to edit a specific user.
*
* @param WP_REST_Request $request The request.
*
* @return void
*/
public function can_edit_user( WP_REST_Request $request ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.0', '\Yoast\WP\SEO\Routes\First_Time_Configuration_Route::can_edit_user' );
}
}

View File

@@ -1,53 +0,0 @@
<?php
namespace Yoast\WP\SEO\Services\Health_Check;
/**
* Passes if the health check can reach the MyYoast API using a recent enough cURL version.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*/
class Curl_Check extends Health_Check {
/**
* Constructor.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @param Curl_Runner $runner The object that implements the actual health check.
* @param Curl_Reports $reports The object that generates WordPress-friendly results.
*/
public function __construct(
Curl_Runner $runner,
Curl_Reports $reports
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
}
/**
* Returns a human-readable label for this health check.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return string The human-readable label.
*/
public function get_test_label() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return '';
}
/**
* Returns the WordPress-friendly health check result.
*
* @return string[] The WordPress-friendly health check result.
*/
protected function get_result() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return [];
}
}

View File

@@ -1,74 +0,0 @@
<?php
namespace Yoast\WP\SEO\Services\Health_Check;
use WPSEO_Shortlinker;
/**
* Presents a set of different messages for the cURL health check.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*/
class Curl_Reports {
/**
* Constructor
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @param Report_Builder_Factory $report_builder_factory The factory for result builder objects.
* This class uses the report builder to generate WordPress-friendly
* health check results.
* @param WPSEO_Shortlinker $shortlinker The WPSEO_Shortlinker object used to generate short links.
*/
public function __construct(
Report_Builder_Factory $report_builder_factory,
WPSEO_Shortlinker $shortlinker
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
}
/**
* Returns the message for a successful health check.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return string[] The message as a WordPress site status report.
*/
public function get_success_result() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return [];
}
/**
* Returns the message for when the health check was unable to reach the MyYoast API.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return string[] The message as a WordPress site status report.
*/
public function get_my_yoast_api_not_reachable_result() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return [];
}
/**
* Returns the message for a successful health check.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return string[] The message as a WordPress site status report.
*/
public function get_no_recent_curl_version_installed_result() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return [];
}
}

View File

@@ -1,113 +0,0 @@
<?php
namespace Yoast\WP\SEO\Services\Health_Check;
use WPSEO_Addon_Manager;
use Yoast\WP\SEO\Helpers\Curl_Helper;
/**
* Runs the Curl health check.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*/
class Curl_Runner implements Runner_Interface {
/**
* Sets the minimum cURL version for this health check to pass.
*/
const MINIMUM_CURL_VERSION = '7.34.0';
/**
* Sets the target URL for testing whether the MyYoast API is reachable.
*/
const MYYOAST_API_REQUEST_URL = 'sites/current';
/**
* Constructor.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @psalm-suppress InvalidClass MyYoast is a product name, so it's an exception to the class naming conventions.
* @param WPSEO_Addon_Manager $addon_manager The add-on manager.
* @param MyYoast_Api_Request_Factory $my_yoast_api_request_factory A MyYoast API request object.
* @param Curl_Helper $curl_helper A cURL helper object for obtaining
* cURL installation information.
*/
public function __construct(
WPSEO_Addon_Manager $addon_manager,
MyYoast_Api_Request_Factory $my_yoast_api_request_factory,
Curl_Helper $curl_helper
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
}
/**
* Runs the health check. Checks if cURL is installed and up to date, and if it's able to reach the MyYoast API
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return void
*/
public function run() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
}
/**
* Returns whether the health check was successful.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return bool True if all the routines for this health check were successful.
*/
public function is_successful() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return true;
}
/**
* Returns whether there are premium plugins installed.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return bool True if there are premium plugins installed.
*/
public function has_premium_plugins_installed() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return false;
}
/**
* Returns whether cURL was able to reach the MyYoast API.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return bool True if cURL was able to reach the MyYoast API.
*/
public function can_reach_my_yoast_api() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return true;
}
/**
* Returns whether the installed cURL version is recent enough.
*
* @deprecated 19.7.2
* @codeCoverageIgnore
*
* @return bool True if the installed cURL version is more recent than MINIMUM_CURL_VERSION.
*/
public function has_recent_curl_version_installed() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.7.2' );
return true;
}
}

View File

@@ -1,56 +0,0 @@
<?php
namespace Yoast\WP\SEO\Services\Health_Check;
/**
* Passes if the health check determines that the site is indexable using Ryte.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
class Ryte_Check extends Health_Check {
/**
* Constructor.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param Ryte_Runner $runner The object that implements the actual health check.
* @param Ryte_Reports $reports The object that generates WordPress-friendly results.
*/
public function __construct(
Ryte_Runner $runner,
Ryte_Reports $reports
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Returns a human-readable label for this health check.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return string The human-readable label.
*/
public function get_test_label() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return '';
}
/**
* Returns the WordPress-friendly health check result.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return string[] The WordPress-friendly health check result.
*/
protected function get_result() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
}

View File

@@ -1,93 +0,0 @@
<?php
namespace Yoast\WP\SEO\Services\Health_Check;
use WPSEO_Shortlinker;
/**
* Presents a set of different messages for the Ryte health check.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
class Ryte_Reports {
use Reports_Trait;
/**
* Constructor
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param Report_Builder_Factory $report_builder_factory The factory for result builder objects.
* This class uses the report builder to generate
* WordPress-friendly health check results.
* @param WPSEO_Shortlinker $shortlinker The WPSEO_Shortlinker object used to generate short
* links.
*/
public function __construct(
Report_Builder_Factory $report_builder_factory,
WPSEO_Shortlinker $shortlinker
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Returns the message for a successful health check.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return string[] The message as a WordPress site status report.
*/
public function get_success_result() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
/**
* Returns the report for a health check result in which the site was not indexable.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return string[] The message as a WordPress site status report.
*/
public function get_not_indexable_result() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
/**
* Returns the report for when the health check was unable to determine indexability.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return string[] The message as a WordPress site status report.
*/
public function get_unknown_indexability_result() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
/**
* Returns the result for when the health check got an error response from Ryte.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param array $response_error The error response from Ryte.
*
* @return string[] The message as a WordPress site status report.
*/
public function get_response_error_result( $response_error ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
}

View File

@@ -1,114 +0,0 @@
<?php
namespace Yoast\WP\SEO\Services\Health_Check;
use WPSEO_Utils;
use Yoast\WP\SEO\Integrations\Admin\Ryte_Integration;
/**
* Runs the Ryte health check.
*
* @deprecated 19.6
* @codeCoverageIgnore
*/
class Ryte_Runner implements Runner_Interface {
/**
* Constructor.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @param Ryte_Integration $ryte The Ryte_Integration object that the health check uses to check indexability.
* @param WPSEO_Utils $utils The WPSEO_Utils object used to determine whether the site is in development mode.
*/
public function __construct(
Ryte_Integration $ryte,
WPSEO_Utils $utils
) {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Runs the health check. Checks if Ryte is accessible and whether the site is indexable.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return void
*/
public function run() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
}
/**
* Checks if the site is a live production site that has Ryte enabled.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return bool
*/
public function should_run() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return false;
}
/**
* Checks if the site is indexable.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return bool
*/
public function is_successful() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return true;
}
/**
* Checks if the site's indexability is unknown.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return bool Returns true if the site indexability is unknown even though getting a response from Ryte was
* successful.
*/
public function has_unknown_indexability() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return false;
}
/**
* Checks whether there was a response error when attempting a request to Ryte.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return bool True if the health check got a valid error response.
*/
public function got_response_error() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return true;
}
/**
* Returns the error response is there was one.
*
* @deprecated 19.6
* @codeCoverageIgnore
*
* @return array|null
*/
public function get_error_response() {
\_deprecated_function( __METHOD__, 'Yoast SEO 19.6' );
return [];
}
}

View File

@@ -15,8 +15,6 @@ use Yoast\WP\SEO\Main;
if ( is_dir( WPSEO_PATH . YOAST_VENDOR_PREFIX_DIRECTORY ) ) {
require_once WPSEO_PATH . YOAST_VENDOR_PREFIX_DIRECTORY . '/guzzlehttp/guzzle/src/functions.php';
require_once WPSEO_PATH . YOAST_VENDOR_PREFIX_DIRECTORY . '/guzzlehttp/psr7/src/functions_include.php';
require_once WPSEO_PATH . YOAST_VENDOR_PREFIX_DIRECTORY . '/guzzlehttp/promises/src/functions_include.php';
}
/**

View File

@@ -1 +1 @@
<?php return array('analysisReport.js' => array('dependencies' => array('lodash', 'react', 'wp-element', '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' => '16b446a0e50c306e0200381dd0955ad8'), 'componentsNew.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-element', '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' => 'eff2a04e3d832212ddba9899cd2223f1'), 'featureFlag.js' => array('dependencies' => array('wp-polyfill'), 'version' => '367f11180a6ee066cdcb129e64b11a79'), 'helpers.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-styled-components-package'), 'version' => 'b6523d35b705c61d0267f8ff3b651a46'), 'replacementVariableEditor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-components', 'wp-element', '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' => '6771c61dc67f07239a70bf90e1c1dd81'), 'searchMetadataPreviews.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', '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' => '63c7bbb19f7341541001c687c772bcef'), 'socialMetadataForms.js' => array('dependencies' => array('lodash', 'react', 'wp-element', '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' => '0416ed289983df171115d6c8dd219acf'), 'styleGuide.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-styled-components-package'), 'version' => '103effa1b716cdae4ab1fe32706d9f58'), 'uiLibrary.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package'), 'version' => '2da0f352c5e521adc1850b300ac17d52'), 'draftJs.js' => array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => 'acad000dc7bd6f441333ae14abda2c4a'), 'jed.js' => array('dependencies' => array('wp-polyfill'), 'version' => '62a87354469ad6c6f67e618483f0aa0f'), 'propTypes.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4bc7d8d99ff07b8daf85f7d8519182aa'), 'redux.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'e7bdfb5ce99876b6529eb719ca574d1e'), 'styledComponents.js' => array('dependencies' => array('react', 'wp-polyfill'), 'version' => '77c9dc51c56ddf3a0b5119514154f04f'), 'components.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-report-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-jed-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-search-metadata-previews-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => '6d3d78872c162e21043d57218f086620'), 'analysis.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill', 'yoast-seo-feature-flag-package'), 'version' => '130de3d08184ee6a635f919304c952ec'));
<?php return array('analysisReport.js' => array('dependencies' => array('lodash', 'react', 'wp-element', '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' => 'e95f437ae34ac15c6a553865448aff6c'), 'componentsNew.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-element', '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' => '8b519e8c9bdc485a5569664d977c43c6'), 'featureFlag.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e10bc9cc72a611812bfc07e62a49fc87'), 'helpers.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-styled-components-package'), 'version' => '6ff44363ca1168d073667ab2f06f91c3'), 'replacementVariableEditor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-components', 'wp-element', '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' => '0a5fcadf27d9de01c826a88c004ea8f5'), 'searchMetadataPreviews.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', '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' => 'd7b44377782fcf3113a7d890fe8527b7'), 'socialMetadataForms.js' => array('dependencies' => array('lodash', 'react', 'wp-element', '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' => '546bcd16f24f0a8af91ec1d987018c82'), 'styleGuide.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-helpers-package', 'yoast-seo-styled-components-package'), 'version' => '5fc06aa928153289521ef4fad66209f2'), 'uiLibrary.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-element', 'wp-polyfill', 'yoast-seo-prop-types-package', 'yoast-seo-redux-js-toolkit-package'), 'version' => '4d5682d33e592dfbbabe89537617a158'), 'draftJs.js' => array('dependencies' => array('react', 'react-dom', 'wp-polyfill'), 'version' => '884a06763ec66f3f2b98ae2228a2166b'), 'jed.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b5de44b7e6b35120d8ba97761f9b11b0'), 'propTypes.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e9441ac3feaba74c71d9793f44b9b676'), 'reactHelmet.js' => array('dependencies' => array('react', 'wp-polyfill', 'yoast-seo-prop-types-package'), 'version' => '23f47eadf3891c8ff5f8acb97ba6b4bc'), 'redux.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '2340e784d7d5751f1fa3189ba31b493f'), 'styledComponents.js' => array('dependencies' => array('react', 'wp-polyfill'), 'version' => 'e0a1a87f171b1b09fda15f788867e8eb'), 'components.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-element', 'wp-i18n', 'wp-polyfill', 'yoast-seo-analysis-report-package', 'yoast-seo-components-new-package', 'yoast-seo-helpers-package', 'yoast-seo-jed-package', 'yoast-seo-prop-types-package', 'yoast-seo-redux-package', 'yoast-seo-replacement-variable-editor-package', 'yoast-seo-search-metadata-previews-package', 'yoast-seo-style-guide-package', 'yoast-seo-styled-components-package'), 'version' => 'e2d878e6411504189a4a41ac5e966b7e'), 'analysis.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill', 'yoast-seo-feature-flag-package'), 'version' => '3374b713a9db5df4c15dc593557f1085'), 'reduxJsToolkit.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-redux-package'), 'version' => 'aae2438a60d27ad77ac35206db5f93bd'));

View File

@@ -1 +1 @@
<?php return array('default.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '19f47693b2c982334cfdf4657aef980c'), 'ar.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '184af465610c9920b8439063afba0806'), 'ca.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '72f4605e103e80ba87bd6269b0f57fec'), 'cs.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '274ea62f5c1be36bce3ef760ca877ecd'), 'de.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '57563d81ad6c43bd64b0935bedbebce3'), 'el.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '4c083eb4c20581f33b319e9bc7c72dbc'), 'en.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'aa368e49b08abd0d18083269333d881d'), 'es.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '53c675ded8d5b1813313f8cbbccadaf6'), 'fa.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '4cedf8e078aa69632e3b9957a0745e05'), 'fr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '714df1d9c1e56b8df63563009d7f1e25'), 'he.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '8850d42282de0a05d68a07c96368e373'), 'hu.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '5a0418f88c12384ff4d79032e13db605'), 'id.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '498f8b2f5a6f1a4af8f82272fa9d538f'), 'it.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '7f619d256584235aed6053f22a690d60'), 'ja.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '425ba8543cfb80e5d18a5715ed6528be'), 'nb.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'c7e7389bf066aa53eedb070aa549922c'), 'nl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'f145d75ea089dd090c10d9b7a0ba32d8'), 'pl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '32db23299989a239215142772ee061ea'), 'pt.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'fca603a260ce67d957d4051a15b6686b'), 'ru.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '215cfdef2e9302bd54c1d44652331174'), 'sk.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '1c47902c41736502e8debb528c028276'), 'sv.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '69e32b16c1213beb73a33015cc8cdd80'), 'tr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '98130c60f12ca63eedbcc0a7a824a69f'));
<?php return array('default.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '19f47693b2c982334cfdf4657aef980c'), 'ar.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '184af465610c9920b8439063afba0806'), 'ca.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '72f4605e103e80ba87bd6269b0f57fec'), 'cs.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '274ea62f5c1be36bce3ef760ca877ecd'), 'de.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '5a1c505485bf422b12687c5bde46a97c'), 'el.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '4c083eb4c20581f33b319e9bc7c72dbc'), 'en.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '5beddce01d83631142eaa55656abccbf'), 'es.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '0beaaaa19b672b8a3b0a4ee7998fa847'), 'fa.js' => array('dependencies' => array('wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '4cedf8e078aa69632e3b9957a0745e05'), 'fr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '916c833dda390539909e6f610df77dae'), 'he.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '8850d42282de0a05d68a07c96368e373'), 'hu.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '5a0418f88c12384ff4d79032e13db605'), 'id.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '498f8b2f5a6f1a4af8f82272fa9d538f'), 'it.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '8685073818451759364380847fc0094f'), 'ja.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '07510a997e9435bb761102696bc82c29'), 'nb.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'c7e7389bf066aa53eedb070aa549922c'), 'nl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'f145d75ea089dd090c10d9b7a0ba32d8'), 'pl.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '32db23299989a239215142772ee061ea'), 'pt.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => 'fca603a260ce67d957d4051a15b6686b'), 'ru.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '215cfdef2e9302bd54c1d44652331174'), 'sk.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '1c47902c41736502e8debb528c028276'), 'sv.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '69e32b16c1213beb73a33015cc8cdd80'), 'tr.js' => array('dependencies' => array('lodash', 'wp-polyfill', 'yoast-seo-analysis-package'), 'version' => '98130c60f12ca63eedbcc0a7a824a69f'));

File diff suppressed because one or more lines are too long

View File

@@ -87,12 +87,12 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\conditionals\\admin\\non_network_admin_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Admin\\Non_Network_Admin_Conditional',
'yoast\\wp\\seo\\conditionals\\admin\\post_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Admin\\Post_Conditional',
'yoast\\wp\\seo\\conditionals\\admin\\posts_overview_or_ajax_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Admin\\Posts_Overview_Or_Ajax_Conditional',
'yoast\\wp\\seo\\conditionals\\admin\\yoast_admin_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Admin\\Yoast_Admin_Conditional',
'yoast\\wp\\seo\\conditionals\\admin_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Admin_Conditional',
'yoast\\wp\\seo\\conditionals\\attachment_redirections_enabled_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Attachment_Redirections_Enabled_Conditional',
'yoast\\wp\\seo\\conditionals\\deactivating_yoast_seo_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Deactivating_Yoast_Seo_Conditional',
'yoast\\wp\\seo\\conditionals\\development_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Development_Conditional',
'yoast\\wp\\seo\\conditionals\\front_end_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Front_End_Conditional',
'yoast\\wp\\seo\\conditionals\\front_end_inspector_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Front_End_Inspector_Conditional',
'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',
@@ -131,6 +131,7 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\conditionals\\updated_importer_framework_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Updated_Importer_Framework_Conditional',
'yoast\\wp\\seo\\conditionals\\user_can_manage_wpseo_options_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\User_Can_Manage_Wpseo_Options_Conditional',
'yoast\\wp\\seo\\conditionals\\user_can_publish_posts_and_pages_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\User_Can_Publish_Posts_And_Pages_Conditional',
'yoast\\wp\\seo\\conditionals\\user_profile_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\User_Profile_Conditional',
'yoast\\wp\\seo\\conditionals\\web_stories_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Web_Stories_Conditional',
'yoast\\wp\\seo\\conditionals\\wincher_automatically_track_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Wincher_Automatically_Track_Conditional',
'yoast\\wp\\seo\\conditionals\\wincher_conditional' => 'Yoast\\WP\\SEO\\Conditionals\\Wincher_Conditional',
@@ -291,6 +292,9 @@ class Cached_Container extends Container
'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\\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',
'yoast\\wp\\seo\\integrations\\alerts\\black_friday_promotion_notification' => 'Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Promotion_Notification',
'yoast\\wp\\seo\\integrations\\alerts\\black_friday_sidebar_checklist_notification' => 'Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Sidebar_Checklist_Notification',
'yoast\\wp\\seo\\integrations\\alerts\\jetpack_boost_pre_publish' => 'Yoast\\WP\\SEO\\Integrations\\Alerts\\Jetpack_Boost_Pre_Publish',
'yoast\\wp\\seo\\integrations\\alerts\\webinar_promo_notification' => 'Yoast\\WP\\SEO\\Integrations\\Alerts\\Webinar_Promo_Notification',
'yoast\\wp\\seo\\integrations\\blocks\\breadcrumbs_block' => 'Yoast\\WP\\SEO\\Integrations\\Blocks\\Breadcrumbs_Block',
@@ -370,6 +374,11 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\integrations\\watchers\\primary_term_watcher' => 'Yoast\\WP\\SEO\\Integrations\\Watchers\\Primary_Term_Watcher',
'yoast\\wp\\seo\\integrations\\watchers\\search_engines_discouraged_watcher' => 'Yoast\\WP\\SEO\\Integrations\\Watchers\\Search_Engines_Discouraged_Watcher',
'yoast\\wp\\seo\\integrations\\xmlrpc' => 'Yoast\\WP\\SEO\\Integrations\\XMLRPC',
'yoast\\wp\\seo\\introductions\\application\\ai_generate_titles_and_descriptions_introduction_upsell' => 'Yoast\\WP\\SEO\\Introductions\\Application\\Ai_Generate_Titles_And_Descriptions_Introduction_Upsell',
'yoast\\wp\\seo\\introductions\\application\\introductions_collector' => 'Yoast\\WP\\SEO\\Introductions\\Application\\Introductions_Collector',
'yoast\\wp\\seo\\introductions\\infrastructure\\wistia_embed_permission_repository' => 'Yoast\\WP\\SEO\\Introductions\\Infrastructure\\Wistia_Embed_Permission_Repository',
'yoast\\wp\\seo\\introductions\\user_interface\\introductions_integration' => 'Yoast\\WP\\SEO\\Introductions\\User_Interface\\Introductions_Integration',
'yoast\\wp\\seo\\introductions\\user_interface\\wistia_embed_permission_route' => 'Yoast\\WP\\SEO\\Introductions\\User_Interface\\Wistia_Embed_Permission_Route',
'yoast\\wp\\seo\\loader' => 'Yoast\\WP\\SEO\\Loader',
'yoast\\wp\\seo\\loggers\\logger' => 'Yoast\\WP\\SEO\\Loggers\\Logger',
'yoast\\wp\\seo\\memoizers\\meta_tags_context_memoizer' => 'Yoast\\WP\\SEO\\Memoizers\\Meta_Tags_Context_Memoizer',
@@ -386,6 +395,9 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\presentations\\indexable_static_home_page_presentation' => 'Yoast\\WP\\SEO\\Presentations\\Indexable_Static_Home_Page_Presentation',
'yoast\\wp\\seo\\presentations\\indexable_static_posts_page_presentation' => 'Yoast\\WP\\SEO\\Presentations\\Indexable_Static_Posts_Page_Presentation',
'yoast\\wp\\seo\\presentations\\indexable_term_archive_presentation' => 'Yoast\\WP\\SEO\\Presentations\\Indexable_Term_Archive_Presentation',
'yoast\\wp\\seo\\promotions\\application\\promotion_manager' => 'Yoast\\WP\\SEO\\Promotions\\Application\\Promotion_Manager',
'yoast\\wp\\seo\\promotions\\domain\\black_friday_checklist_promotion' => 'Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Checklist_Promotion',
'yoast\\wp\\seo\\promotions\\domain\\black_friday_promotion' => 'Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Promotion',
'yoast\\wp\\seo\\repositories\\indexable_cleanup_repository' => 'Yoast\\WP\\SEO\\Repositories\\Indexable_Cleanup_Repository',
'yoast\\wp\\seo\\repositories\\indexable_hierarchy_repository' => 'Yoast\\WP\\SEO\\Repositories\\Indexable_Hierarchy_Repository',
'yoast\\wp\\seo\\repositories\\indexable_repository' => 'Yoast\\WP\\SEO\\Repositories\\Indexable_Repository',
@@ -433,6 +445,7 @@ class Cached_Container extends Container
'yoast\\wp\\seo\\surfaces\\open_graph_helpers_surface' => 'Yoast\\WP\\SEO\\Surfaces\\Open_Graph_Helpers_Surface',
'yoast\\wp\\seo\\surfaces\\schema_helpers_surface' => 'Yoast\\WP\\SEO\\Surfaces\\Schema_Helpers_Surface',
'yoast\\wp\\seo\\surfaces\\twitter_helpers_surface' => 'Yoast\\WP\\SEO\\Surfaces\\Twitter_Helpers_Surface',
'yoast\\wp\\seo\\user_profiles_additions\\user_interface\\user_profiles_additions_ui' => 'Yoast\\WP\\SEO\\User_Profiles_Additions\\User_Interface\\User_Profiles_Additions_Ui',
'yoast\\wp\\seo\\values\\images' => 'Yoast\\WP\\SEO\\Values\\Images',
'yoast\\wp\\seo\\values\\indexables\\indexable_builder_versions' => 'Yoast\\WP\\SEO\\Values\\Indexables\\Indexable_Builder_Versions',
'yoast\\wp\\seo\\values\\open_graph\\images' => 'Yoast\\WP\\SEO\\Values\\Open_Graph\\Images',
@@ -505,12 +518,12 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Conditionals\\Admin\\Non_Network_Admin_Conditional' => 'getNonNetworkAdminConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Admin\\Post_Conditional' => 'getPostConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Admin\\Posts_Overview_Or_Ajax_Conditional' => 'getPostsOverviewOrAjaxConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Admin\\Yoast_Admin_Conditional' => 'getYoastAdminConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Admin_Conditional' => 'getAdminConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Attachment_Redirections_Enabled_Conditional' => 'getAttachmentRedirectionsEnabledConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Deactivating_Yoast_Seo_Conditional' => 'getDeactivatingYoastSeoConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Development_Conditional' => 'getDevelopmentConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Front_End_Conditional' => 'getFrontEndConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Front_End_Inspector_Conditional' => 'getFrontEndInspectorConditionalService',
'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',
@@ -549,6 +562,7 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Conditionals\\Updated_Importer_Framework_Conditional' => 'getUpdatedImporterFrameworkConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\User_Can_Manage_Wpseo_Options_Conditional' => 'getUserCanManageWpseoOptionsConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\User_Can_Publish_Posts_And_Pages_Conditional' => 'getUserCanPublishPostsAndPagesConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\User_Profile_Conditional' => 'getUserProfileConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\WP_CRON_Enabled_Conditional' => 'getWPCRONEnabledConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\WP_Robots_Conditional' => 'getWPRobotsConditionalService',
'Yoast\\WP\\SEO\\Conditionals\\Web_Stories_Conditional' => 'getWebStoriesConditionalService',
@@ -709,6 +723,9 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Integrations\\Admin\\Redirects_Page_Integration' => 'getRedirectsPageIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Social_Templates_Integration' => 'getSocialTemplatesIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Admin\\Workouts_Integration' => 'getWorkoutsIntegrationService',
'Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Product_Editor_Checklist_Notification' => 'getBlackFridayProductEditorChecklistNotificationService',
'Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Promotion_Notification' => 'getBlackFridayPromotionNotificationService',
'Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Sidebar_Checklist_Notification' => 'getBlackFridaySidebarChecklistNotificationService',
'Yoast\\WP\\SEO\\Integrations\\Alerts\\Jetpack_Boost_Pre_Publish' => 'getJetpackBoostPrePublishService',
'Yoast\\WP\\SEO\\Integrations\\Alerts\\Webinar_Promo_Notification' => 'getWebinarPromoNotificationService',
'Yoast\\WP\\SEO\\Integrations\\Blocks\\Breadcrumbs_Block' => 'getBreadcrumbsBlockService',
@@ -788,6 +805,11 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Integrations\\Watchers\\Primary_Term_Watcher' => 'getPrimaryTermWatcherService',
'Yoast\\WP\\SEO\\Integrations\\Watchers\\Search_Engines_Discouraged_Watcher' => 'getSearchEnginesDiscouragedWatcherService',
'Yoast\\WP\\SEO\\Integrations\\XMLRPC' => 'getXMLRPCService',
'Yoast\\WP\\SEO\\Introductions\\Application\\Ai_Generate_Titles_And_Descriptions_Introduction_Upsell' => 'getAiGenerateTitlesAndDescriptionsIntroductionUpsellService',
'Yoast\\WP\\SEO\\Introductions\\Application\\Introductions_Collector' => 'getIntroductionsCollectorService',
'Yoast\\WP\\SEO\\Introductions\\Infrastructure\\Wistia_Embed_Permission_Repository' => 'getWistiaEmbedPermissionRepositoryService',
'Yoast\\WP\\SEO\\Introductions\\User_Interface\\Introductions_Integration' => 'getIntroductionsIntegrationService',
'Yoast\\WP\\SEO\\Introductions\\User_Interface\\Wistia_Embed_Permission_Route' => 'getWistiaEmbedPermissionRouteService',
'Yoast\\WP\\SEO\\Loader' => 'getLoaderService',
'Yoast\\WP\\SEO\\Loggers\\Logger' => 'getLoggerService',
'Yoast\\WP\\SEO\\Memoizers\\Meta_Tags_Context_Memoizer' => 'getMetaTagsContextMemoizerService',
@@ -804,6 +826,9 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Presentations\\Indexable_Static_Home_Page_Presentation' => 'getIndexableStaticHomePagePresentationService',
'Yoast\\WP\\SEO\\Presentations\\Indexable_Static_Posts_Page_Presentation' => 'getIndexableStaticPostsPagePresentationService',
'Yoast\\WP\\SEO\\Presentations\\Indexable_Term_Archive_Presentation' => 'getIndexableTermArchivePresentationService',
'Yoast\\WP\\SEO\\Promotions\\Application\\Promotion_Manager' => 'getPromotionManagerService',
'Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Checklist_Promotion' => 'getBlackFridayChecklistPromotionService',
'Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Promotion' => 'getBlackFridayPromotionService',
'Yoast\\WP\\SEO\\Repositories\\Indexable_Cleanup_Repository' => 'getIndexableCleanupRepositoryService',
'Yoast\\WP\\SEO\\Repositories\\Indexable_Hierarchy_Repository' => 'getIndexableHierarchyRepositoryService',
'Yoast\\WP\\SEO\\Repositories\\Indexable_Repository' => 'getIndexableRepositoryService',
@@ -851,6 +876,7 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Surfaces\\Open_Graph_Helpers_Surface' => 'getOpenGraphHelpersSurfaceService',
'Yoast\\WP\\SEO\\Surfaces\\Schema_Helpers_Surface' => 'getSchemaHelpersSurfaceService',
'Yoast\\WP\\SEO\\Surfaces\\Twitter_Helpers_Surface' => 'getTwitterHelpersSurfaceService',
'Yoast\\WP\\SEO\\User_Profiles_Additions\\User_Interface\\User_Profiles_Additions_Ui' => 'getUserProfilesAdditionsUiService',
'Yoast\\WP\\SEO\\Values\\Images' => 'getImagesService',
'Yoast\\WP\\SEO\\Values\\Indexables\\Indexable_Builder_Versions' => 'getIndexableBuilderVersionsService',
'Yoast\\WP\\SEO\\Values\\Open_Graph\\Images' => 'getImages2Service',
@@ -880,7 +906,12 @@ class Cached_Container extends Container
'Yoast\\WP\\SEO\\Analytics\\Domain\\To_Be_Cleaned_Indexable_Bucket' => true,
'Yoast\\WP\\SEO\\Analytics\\Domain\\To_Be_Cleaned_Indexable_Count' => true,
'Yoast\\WP\\SEO\\Content_Type_Visibility\\Application\\Content_Type_Visibility_Dismiss_Notifications' => true,
'Yoast\\WP\\SEO\\Introductions\\Domain\\Introduction_Interface' => true,
'Yoast\\WP\\SEO\\Introductions\\Domain\\Introduction_Item' => true,
'Yoast\\WP\\SEO\\Introductions\\Domain\\Introductions_Bucket' => true,
'Yoast\\WP\\SEO\\Presenters\\Robots_Txt_Presenter' => true,
'Yoast\\WP\\SEO\\Promotions\\Application\\Promotion_Manager_Interface' => true,
'Yoast\\WP\\SEO\\Promotions\\Domain\\Time_Interval' => true,
];
}
@@ -1443,7 +1474,7 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Builders\\Indexable_Author_Builder'];
}
$this->services['Yoast\\WP\\SEO\\Builders\\Indexable_Author_Builder'] = $instance = new \Yoast\WP\SEO\Builders\Indexable_Author_Builder(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Author_Archive_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Author_Archive_Helper'] : $this->getAuthorArchiveHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Values\\Indexables\\Indexable_Builder_Versions']) ? $this->services['Yoast\\WP\\SEO\\Values\\Indexables\\Indexable_Builder_Versions'] : ($this->services['Yoast\\WP\\SEO\\Values\\Indexables\\Indexable_Builder_Versions'] = new \Yoast\WP\SEO\Values\Indexables\Indexable_Builder_Versions())) && false ?: '_'}, $a, ${($_ = isset($this->services['wpdb']) ? $this->services['wpdb'] : $this->getWpdbService()) && false ?: '_'});
$this->services['Yoast\\WP\\SEO\\Builders\\Indexable_Author_Builder'] = $instance = new \Yoast\WP\SEO\Builders\Indexable_Author_Builder(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Author_Archive_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Author_Archive_Helper'] : $this->getAuthorArchiveHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Values\\Indexables\\Indexable_Builder_Versions']) ? $this->services['Yoast\\WP\\SEO\\Values\\Indexables\\Indexable_Builder_Versions'] : ($this->services['Yoast\\WP\\SEO\\Values\\Indexables\\Indexable_Builder_Versions'] = new \Yoast\WP\SEO\Values\Indexables\Indexable_Builder_Versions())) && 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 ?: '_'}, $a, ${($_ = isset($this->services['wpdb']) ? $this->services['wpdb'] : $this->getWpdbService()) && false ?: '_'});
$instance->set_social_image_helpers(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Image_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Image_Helper'] : $this->getImageHelperService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Open_Graph\\Image_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Open_Graph\\Image_Helper'] : $this->getImageHelper2Service()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Twitter\\Image_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Twitter\\Image_Helper'] : $this->getImageHelper4Service()) && false ?: '_'});
@@ -1747,6 +1778,16 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Admin\\Posts_Overview_Or_Ajax_Conditional'] = new \Yoast\WP\SEO\Conditionals\Admin\Posts_Overview_Or_Ajax_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Admin\Yoast_Admin_Conditional' shared autowired service.
*
* @return \Yoast\WP\SEO\Conditionals\Admin\Yoast_Admin_Conditional
*/
protected function getYoastAdminConditionalService()
{
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Admin\\Yoast_Admin_Conditional'] = new \Yoast\WP\SEO\Conditionals\Admin\Yoast_Admin_Conditional(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\Current_Page_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Current_Page_Helper'] : $this->getCurrentPageHelperService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Admin_Conditional' shared autowired service.
*
@@ -1797,20 +1838,6 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Front_End_Conditional'] = new \Yoast\WP\SEO\Conditionals\Front_End_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Front_End_Inspector_Conditional' shared autowired service.
*
* @return \Yoast\WP\SEO\Conditionals\Front_End_Inspector_Conditional
*
* @deprecated Yoast\WP\SEO\Conditionals\Front_End_Inspector_Conditional is deprecated since version 19.5!
*/
protected function getFrontEndInspectorConditionalService()
{
@trigger_error('Yoast\\WP\\SEO\\Conditionals\\Front_End_Inspector_Conditional is deprecated since version 19.5!', E_USER_DEPRECATED);
return $this->services['Yoast\\WP\\SEO\\Conditionals\\Front_End_Inspector_Conditional'] = new \Yoast\WP\SEO\Conditionals\Front_End_Inspector_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\Get_Request_Conditional' shared autowired service.
*
@@ -2211,6 +2238,16 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Conditionals\\User_Can_Publish_Posts_And_Pages_Conditional'] = new \Yoast\WP\SEO\Conditionals\User_Can_Publish_Posts_And_Pages_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\User_Profile_Conditional' shared autowired service.
*
* @return \Yoast\WP\SEO\Conditionals\User_Profile_Conditional
*/
protected function getUserProfileConditionalService()
{
return $this->services['Yoast\\WP\\SEO\\Conditionals\\User_Profile_Conditional'] = new \Yoast\WP\SEO\Conditionals\User_Profile_Conditional();
}
/**
* Gets the public 'Yoast\WP\SEO\Conditionals\WP_CRON_Enabled_Conditional' shared autowired service.
*
@@ -3862,6 +3899,36 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Integrations\\Admin\\Workouts_Integration'] = new \Yoast\WP\SEO\Integrations\Admin\Workouts_Integration(${($_ = isset($this->services['WPSEO_Addon_Manager']) ? $this->services['WPSEO_Addon_Manager'] : $this->getWPSEOAddonManagerService()) && false ?: '_'}, ${($_ = isset($this->services['WPSEO_Admin_Asset_Manager']) ? $this->services['WPSEO_Admin_Asset_Manager'] : $this->getWPSEOAdminAssetManagerService()) && 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\Alerts\Black_Friday_Product_Editor_Checklist_Notification' shared autowired service.
*
* @return \Yoast\WP\SEO\Integrations\Alerts\Black_Friday_Product_Editor_Checklist_Notification
*/
protected function getBlackFridayProductEditorChecklistNotificationService()
{
return $this->services['Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Product_Editor_Checklist_Notification'] = new \Yoast\WP\SEO\Integrations\Alerts\Black_Friday_Product_Editor_Checklist_Notification();
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Alerts\Black_Friday_Promotion_Notification' shared autowired service.
*
* @return \Yoast\WP\SEO\Integrations\Alerts\Black_Friday_Promotion_Notification
*/
protected function getBlackFridayPromotionNotificationService()
{
return $this->services['Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Promotion_Notification'] = new \Yoast\WP\SEO\Integrations\Alerts\Black_Friday_Promotion_Notification();
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Alerts\Black_Friday_Sidebar_Checklist_Notification' shared autowired service.
*
* @return \Yoast\WP\SEO\Integrations\Alerts\Black_Friday_Sidebar_Checklist_Notification
*/
protected function getBlackFridaySidebarChecklistNotificationService()
{
return $this->services['Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Sidebar_Checklist_Notification'] = new \Yoast\WP\SEO\Integrations\Alerts\Black_Friday_Sidebar_Checklist_Notification();
}
/**
* Gets the public 'Yoast\WP\SEO\Integrations\Alerts\Jetpack_Boost_Pre_Publish' shared autowired service.
*
@@ -4239,7 +4306,7 @@ class Cached_Container extends Container
*/
protected function getElementorService()
{
return $this->services['Yoast\\WP\\SEO\\Integrations\\Third_Party\\Elementor'] = new \Yoast\WP\SEO\Integrations\Third_Party\Elementor(${($_ = isset($this->services['WPSEO_Admin_Asset_Manager']) ? $this->services['WPSEO_Admin_Asset_Manager'] : $this->getWPSEOAdminAssetManagerService()) && 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\\Capability_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Capability_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Capability_Helper'] = new \Yoast\WP\SEO\Helpers\Capability_Helper())) && false ?: '_'});
return $this->services['Yoast\\WP\\SEO\\Integrations\\Third_Party\\Elementor'] = new \Yoast\WP\SEO\Integrations\Third_Party\Elementor(${($_ = isset($this->services['WPSEO_Admin_Asset_Manager']) ? $this->services['WPSEO_Admin_Asset_Manager'] : $this->getWPSEOAdminAssetManagerService()) && 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\\Capability_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\Capability_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\Capability_Helper'] = new \Yoast\WP\SEO\Helpers\Capability_Helper())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Promotions\\Application\\Promotion_Manager']) ? $this->services['Yoast\\WP\\SEO\\Promotions\\Application\\Promotion_Manager'] : $this->getPromotionManagerService()) && false ?: '_'});
}
/**
@@ -4666,6 +4733,56 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Integrations\\XMLRPC'] = new \Yoast\WP\SEO\Integrations\XMLRPC();
}
/**
* Gets the public 'Yoast\WP\SEO\Introductions\Application\Ai_Generate_Titles_And_Descriptions_Introduction_Upsell' shared autowired service.
*
* @return \Yoast\WP\SEO\Introductions\Application\Ai_Generate_Titles_And_Descriptions_Introduction_Upsell
*/
protected function getAiGenerateTitlesAndDescriptionsIntroductionUpsellService()
{
return $this->services['Yoast\\WP\\SEO\\Introductions\\Application\\Ai_Generate_Titles_And_Descriptions_Introduction_Upsell'] = new \Yoast\WP\SEO\Introductions\Application\Ai_Generate_Titles_And_Descriptions_Introduction_Upsell(${($_ = 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 ?: '_'}, ${($_ = 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\Introductions\Application\Introductions_Collector' shared autowired service.
*
* @return \Yoast\WP\SEO\Introductions\Application\Introductions_Collector
*/
protected function getIntroductionsCollectorService()
{
return $this->services['Yoast\\WP\\SEO\\Introductions\\Application\\Introductions_Collector'] = new \Yoast\WP\SEO\Introductions\Application\Introductions_Collector(${($_ = isset($this->services['Yoast\\WP\\SEO\\Introductions\\Application\\Ai_Generate_Titles_And_Descriptions_Introduction_Upsell']) ? $this->services['Yoast\\WP\\SEO\\Introductions\\Application\\Ai_Generate_Titles_And_Descriptions_Introduction_Upsell'] : $this->getAiGenerateTitlesAndDescriptionsIntroductionUpsellService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Introductions\Infrastructure\Wistia_Embed_Permission_Repository' shared autowired service.
*
* @return \Yoast\WP\SEO\Introductions\Infrastructure\Wistia_Embed_Permission_Repository
*/
protected function getWistiaEmbedPermissionRepositoryService()
{
return $this->services['Yoast\\WP\\SEO\\Introductions\\Infrastructure\\Wistia_Embed_Permission_Repository'] = new \Yoast\WP\SEO\Introductions\Infrastructure\Wistia_Embed_Permission_Repository(${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] = new \Yoast\WP\SEO\Helpers\User_Helper())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Introductions\User_Interface\Introductions_Integration' shared autowired service.
*
* @return \Yoast\WP\SEO\Introductions\User_Interface\Introductions_Integration
*/
protected function getIntroductionsIntegrationService()
{
return $this->services['Yoast\\WP\\SEO\\Introductions\\User_Interface\\Introductions_Integration'] = new \Yoast\WP\SEO\Introductions\User_Interface\Introductions_Integration(${($_ = isset($this->services['WPSEO_Admin_Asset_Manager']) ? $this->services['WPSEO_Admin_Asset_Manager'] : $this->getWPSEOAdminAssetManagerService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Introductions\\Application\\Introductions_Collector']) ? $this->services['Yoast\\WP\\SEO\\Introductions\\Application\\Introductions_Collector'] : $this->getIntroductionsCollectorService()) && 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 ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] = new \Yoast\WP\SEO\Helpers\User_Helper())) && 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\\Introductions\\Infrastructure\\Wistia_Embed_Permission_Repository']) ? $this->services['Yoast\\WP\\SEO\\Introductions\\Infrastructure\\Wistia_Embed_Permission_Repository'] : $this->getWistiaEmbedPermissionRepositoryService()) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Introductions\User_Interface\Wistia_Embed_Permission_Route' shared autowired service.
*
* @return \Yoast\WP\SEO\Introductions\User_Interface\Wistia_Embed_Permission_Route
*/
protected function getWistiaEmbedPermissionRouteService()
{
return $this->services['Yoast\\WP\\SEO\\Introductions\\User_Interface\\Wistia_Embed_Permission_Route'] = new \Yoast\WP\SEO\Introductions\User_Interface\Wistia_Embed_Permission_Route(${($_ = isset($this->services['Yoast\\WP\\SEO\\Introductions\\Infrastructure\\Wistia_Embed_Permission_Repository']) ? $this->services['Yoast\\WP\\SEO\\Introductions\\Infrastructure\\Wistia_Embed_Permission_Repository'] : $this->getWistiaEmbedPermissionRepositoryService()) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper']) ? $this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] : ($this->services['Yoast\\WP\\SEO\\Helpers\\User_Helper'] = new \Yoast\WP\SEO\Helpers\User_Helper())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Loader' shared autowired service.
*
@@ -4736,6 +4853,9 @@ class Cached_Container extends Container
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Admin\\Redirect_Integration');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Admin\\Redirects_Page_Integration');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Admin\\Workouts_Integration');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Product_Editor_Checklist_Notification');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Promotion_Notification');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Alerts\\Black_Friday_Sidebar_Checklist_Notification');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Alerts\\Jetpack_Boost_Pre_Publish');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Alerts\\Webinar_Promo_Notification');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Blocks\\Internal_Linking_Category');
@@ -4812,6 +4932,8 @@ class Cached_Container extends Container
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Watchers\\Primary_Term_Watcher');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\Watchers\\Search_Engines_Discouraged_Watcher');
$instance->register_integration('Yoast\\WP\\SEO\\Integrations\\XMLRPC');
$instance->register_integration('Yoast\\WP\\SEO\\Introductions\\User_Interface\\Introductions_Integration');
$instance->register_route('Yoast\\WP\\SEO\\Introductions\\User_Interface\\Wistia_Embed_Permission_Route');
$instance->register_route('Yoast\\WP\\SEO\\Routes\\Alert_Dismissal_Route');
$instance->register_route('Yoast\\WP\\SEO\\Routes\\First_Time_Configuration_Route');
$instance->register_route('Yoast\\WP\\SEO\\Routes\\Importing_Route');
@@ -4824,6 +4946,7 @@ class Cached_Container extends Container
$instance->register_route('Yoast\\WP\\SEO\\Routes\\Wincher_Route');
$instance->register_route('Yoast\\WP\\SEO\\Routes\\Workouts_Route');
$instance->register_route('Yoast\\WP\\SEO\\Routes\\Yoast_Head_REST_Field');
$instance->register_integration('Yoast\\WP\\SEO\\User_Profiles_Additions\\User_Interface\\User_Profiles_Additions_Ui');
return $instance;
}
@@ -5040,6 +5163,36 @@ class Cached_Container extends Container
return $instance;
}
/**
* Gets the public 'Yoast\WP\SEO\Promotions\Application\Promotion_Manager' shared autowired service.
*
* @return \Yoast\WP\SEO\Promotions\Application\Promotion_Manager
*/
protected function getPromotionManagerService()
{
return $this->services['Yoast\\WP\\SEO\\Promotions\\Application\\Promotion_Manager'] = new \Yoast\WP\SEO\Promotions\Application\Promotion_Manager(${($_ = isset($this->services['Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Checklist_Promotion']) ? $this->services['Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Checklist_Promotion'] : ($this->services['Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Checklist_Promotion'] = new \Yoast\WP\SEO\Promotions\Domain\Black_Friday_Checklist_Promotion())) && false ?: '_'}, ${($_ = isset($this->services['Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Promotion']) ? $this->services['Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Promotion'] : ($this->services['Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Promotion'] = new \Yoast\WP\SEO\Promotions\Domain\Black_Friday_Promotion())) && false ?: '_'});
}
/**
* Gets the public 'Yoast\WP\SEO\Promotions\Domain\Black_Friday_Checklist_Promotion' shared autowired service.
*
* @return \Yoast\WP\SEO\Promotions\Domain\Black_Friday_Checklist_Promotion
*/
protected function getBlackFridayChecklistPromotionService()
{
return $this->services['Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Checklist_Promotion'] = new \Yoast\WP\SEO\Promotions\Domain\Black_Friday_Checklist_Promotion();
}
/**
* Gets the public 'Yoast\WP\SEO\Promotions\Domain\Black_Friday_Promotion' shared autowired service.
*
* @return \Yoast\WP\SEO\Promotions\Domain\Black_Friday_Promotion
*/
protected function getBlackFridayPromotionService()
{
return $this->services['Yoast\\WP\\SEO\\Promotions\\Domain\\Black_Friday_Promotion'] = new \Yoast\WP\SEO\Promotions\Domain\Black_Friday_Promotion();
}
/**
* Gets the public 'Yoast\WP\SEO\Repositories\Indexable_Cleanup_Repository' shared autowired service.
*
@@ -5533,6 +5686,16 @@ class Cached_Container extends Container
return $this->services['Yoast\\WP\\SEO\\Surfaces\\Twitter_Helpers_Surface'] = new \Yoast\WP\SEO\Surfaces\Twitter_Helpers_Surface($this);
}
/**
* Gets the public 'Yoast\WP\SEO\User_Profiles_Additions\User_Interface\User_Profiles_Additions_Ui' shared autowired service.
*
* @return \Yoast\WP\SEO\User_Profiles_Additions\User_Interface\User_Profiles_Additions_Ui
*/
protected function getUserProfilesAdditionsUiService()
{
return $this->services['Yoast\\WP\\SEO\\User_Profiles_Additions\\User_Interface\\User_Profiles_Additions_Ui'] = new \Yoast\WP\SEO\User_Profiles_Additions\User_Interface\User_Profiles_Additions_Ui();
}
/**
* Gets the public 'Yoast\WP\SEO\Values\Images' shared autowired service.
*

View File

@@ -308,7 +308,8 @@ class Image_Helper {
return 0;
}
if ( ! $this->options_helper->get( 'disable-attachment' ) ) {
/** The `wpseo_force_creating_and_using_attachment_indexables` filter is documented in indexable-link-builder.php */
if ( ! $this->options_helper->get( 'disable-attachment' ) || \apply_filters( 'wpseo_force_creating_and_using_attachment_indexables', false ) ) {
// Strip out the size part of an image URL.
$url = \preg_replace( '/(.*)-\d+x\d+\.(jpeg|jpg|png|gif)$/', '$1.$2', $url );

View File

@@ -67,7 +67,12 @@ class Pagination_Helper {
public function get_paginated_url( $url, $page, $add_pagination_base = true, $pagination_query_name = 'page' ) {
$wp_rewrite = $this->wp_rewrite_wrapper->get();
if ( $wp_rewrite->using_permalinks() ) {
$key_query_loop = $this->get_key_query_loop();
if ( $key_query_loop ) {
$pagination_query_name = $key_query_loop;
}
if ( $wp_rewrite->using_permalinks() && ! $key_query_loop ) {
$url_parts = \wp_parse_url( $url );
$has_url_params = \array_key_exists( 'query', $url_parts );
@@ -113,9 +118,18 @@ class Pagination_Helper {
* @return int The current archive page.
*/
public function get_current_archive_page_number() {
$wp_query = $this->wp_query_wrapper->get_main_query();
$wp_query = $this->wp_query_wrapper->get_main_query();
$page_number = (int) $wp_query->get( 'paged' );
if ( $page_number > 1 ) {
return $page_number;
}
return (int) $wp_query->get( 'paged' );
$query_loop_page_number = $this->get_page_number_from_query_loop();
if ( $query_loop_page_number ) {
return $query_loop_page_number;
}
return 0;
}
/**
@@ -126,6 +140,12 @@ class Pagination_Helper {
public function get_current_post_page_number() {
$wp_query = $this->wp_query_wrapper->get_main_query();
$query_loop_page_number = $this->get_page_number_from_query_loop();
if ( $query_loop_page_number ) {
return $query_loop_page_number;
}
return (int) $wp_query->get( 'page' );
}
@@ -141,7 +161,47 @@ class Pagination_Helper {
return $page_number;
}
$query_loop_page_number = $this->get_page_number_from_query_loop();
if ( $query_loop_page_number ) {
return $query_loop_page_number;
}
// Get the page number for a page in a paginated post.
return \get_query_var( 'page', 1 );
}
/**
* Returns the key of the query loop.
*
* @return string The key of the query loop.
*/
public function get_key_query_loop() {
$regex_pattern = '/^query-\d+-page$/';
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- not form data.
foreach ( $_GET as $key => $value ) {
if ( \preg_match( $regex_pattern, $key ) ) {
return $key;
}
}
return '';
}
/**
* Returns the page number from the query loop.
*
* @return string The page number from the query loop.
*/
public function get_page_number_from_query_loop() {
$key_query_loop = $this->get_key_query_loop();
if ( $key_query_loop ) {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.NonceVerification.Recommended -- Validated in get_key_query_loop().
$page_number = (int) $_GET[ $key_query_loop ];
if ( $page_number > 1 ) {
return $page_number;
}
}
return '';
}
}

View File

@@ -50,4 +50,13 @@ class Product_Helper {
return null;
}
/**
* Gets the version.
*
* @return string The version.
*/
public function get_version() {
return \WPSEO_VERSION;
}
}

View File

@@ -65,7 +65,7 @@ class Social_Profiles_Helper {
*/
$person_social_profile_fields = \apply_filters( 'wpseo_person_social_profile_fields', $this->person_social_profile_fields );
return $person_social_profile_fields;
return (array) $person_social_profile_fields;
}
/**
@@ -81,7 +81,7 @@ class Social_Profiles_Helper {
*/
$organization_social_profile_fields = \apply_filters( 'wpseo_organization_social_profile_fields', $this->organization_social_profile_fields );
return $organization_social_profile_fields;
return (array) $organization_social_profile_fields;
}
/**

View File

@@ -109,7 +109,9 @@ class Admin_Columns_Cache_Integration implements Integration_Interface {
$indexables = $this->indexable_repository->find_by_multiple_ids_and_type( $post_ids, 'post', false );
foreach ( $indexables as $indexable ) {
$this->indexable_cache[ $indexable->object_id ] = $indexable;
if ( $indexable instanceof Indexable ) {
$this->indexable_cache[ $indexable->object_id ] = $indexable;
}
}
}

View File

@@ -7,7 +7,6 @@ use WPSEO_Addon_Manager;
use WPSEO_Admin_Asset_Manager;
use WPSEO_Option_Tab;
use WPSEO_Shortlinker;
use WPSEO_Utils;
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Options_Helper;
@@ -140,8 +139,8 @@ class First_Time_Configuration_Integration implements Integration_Interface {
$this->admin_asset_manager->enqueue_script( 'indexation' );
$this->admin_asset_manager->enqueue_script( 'first-time-configuration' );
$this->admin_asset_manager->enqueue_style( 'first-time-configuration' );
$this->admin_asset_manager->enqueue_style( 'admin-css' );
$this->admin_asset_manager->enqueue_style( 'tailwind' );
$this->admin_asset_manager->enqueue_style( 'monorepo' );
$data = [
@@ -185,78 +184,44 @@ class First_Time_Configuration_Integration implements Integration_Interface {
$selected_option_label = $selected_option['label'];
}
$this->admin_asset_manager->add_inline_script(
'first-time-configuration',
\sprintf(
'window.wpseoFirstTimeConfigurationData = {
"canEditUser": %d,
"companyOrPerson": "%s",
"companyOrPersonLabel": "%s",
"companyName": "%s",
"fallbackCompanyName": "%s",
"websiteName": "%s",
"fallbackWebsiteName": "%s",
"companyLogo": "%s",
"companyLogoFallback": "%s",
"companyLogoId": %d,
"finishedSteps": %s,
"personId": %d,
"personName": "%s",
"personLogo": "%s",
"personLogoFallback": "%s",
"personLogoId": %d,
"siteTagline": "%s",
"socialProfiles": {
"facebookUrl": "%s",
"twitterUsername": "%s",
"otherSocialUrls": %s,
},
"isPremium": %d,
"tracking": %d,
"isTrackingAllowedMultisite": %d,
"isMainSite": %d,
"companyOrPersonOptions": %s,
"shouldForceCompany": %d,
"knowledgeGraphMessage": "%s",
"shortlinks": {
"gdpr": "%s",
"configIndexables": "%s",
"configIndexablesBenefits": "%s",
},
};',
$this->can_edit_profile( $person_id ),
$this->is_company_or_person(),
$selected_option_label,
$this->get_company_name(),
$this->get_fallback_company_name( $this->get_company_name() ),
$this->get_website_name(),
$this->get_fallback_website_name( $this->get_website_name() ),
$this->get_company_logo(),
$this->get_company_fallback_logo( $this->get_company_logo() ),
$this->get_company_logo_id(),
WPSEO_Utils::format_json_encode( $finished_steps ),
$person_id,
$this->get_person_name(),
$this->get_person_logo(),
$this->get_person_fallback_logo( $this->get_person_logo() ),
$this->get_person_logo_id(),
$this->get_site_tagline(),
$social_profiles['facebook_site'],
$social_profiles['twitter_site'],
WPSEO_Utils::format_json_encode( $social_profiles['other_social_urls'] ),
$this->product_helper->is_premium(),
$this->has_tracking_enabled(),
$this->is_tracking_enabled_multisite(),
$this->is_main_site(),
WPSEO_Utils::format_json_encode( $options ),
$this->should_force_company(),
$knowledge_graph_message,
$this->shortlinker->build_shortlink( 'https://yoa.st/gdpr-config-workout' ),
$this->shortlinker->build_shortlink( 'https://yoa.st/config-indexables' ),
$this->shortlinker->build_shortlink( 'https://yoa.st/config-indexables-benefits' )
),
'before'
);
$data_ftc = [
'canEditUser' => $this->can_edit_profile( $person_id ),
'companyOrPerson' => $this->is_company_or_person(),
'companyOrPersonLabel' => $selected_option_label,
'companyName' => $this->get_company_name(),
'fallbackCompanyName' => $this->get_fallback_company_name( $this->get_company_name() ),
'websiteName' => $this->get_website_name(),
'fallbackWebsiteName' => $this->get_fallback_website_name( $this->get_website_name() ),
'companyLogo' => $this->get_company_logo(),
'companyLogoFallback' => $this->get_company_fallback_logo( $this->get_company_logo() ),
'companyLogoId' => $this->get_person_logo_id(),
'finishedSteps' => $finished_steps,
'personId' => (int) $person_id,
'personName' => $this->get_person_name(),
'personLogo' => $this->get_person_logo(),
'personLogoFallback' => $this->get_person_fallback_logo( $this->get_person_logo() ),
'personLogoId' => $this->get_person_logo_id(),
'siteTagline' => $this->get_site_tagline(),
'socialProfiles' => [
'facebookUrl' => $social_profiles['facebook_site'],
'twitterUsername' => $social_profiles['twitter_site'],
'otherSocialUrls' => $social_profiles['other_social_urls'],
],
'isPremium' => $this->product_helper->is_premium(),
'tracking' => $this->has_tracking_enabled(),
'isTrackingAllowedMultisite' => $this->is_tracking_enabled_multisite(),
'isMainSite' => $this->is_main_site(),
'companyOrPersonOptions' => $options,
'shouldForceCompany' => $this->should_force_company(),
'knowledgeGraphMessage' => $knowledge_graph_message,
'shortlinks' => [
'gdpr' => $this->shortlinker->build_shortlink( 'https://yoa.st/gdpr-config-workout' ),
'configIndexables' => $this->shortlinker->build_shortlink( 'https://yoa.st/config-indexables' ),
'configIndexablesBenefits' => $this->shortlinker->build_shortlink( 'https://yoa.st/config-indexables-benefits' ),
],
];
$this->admin_asset_manager->localize_script( 'first-time-configuration', 'wpseoFirstTimeConfigurationData', $data_ftc );
}
/**

View File

@@ -41,13 +41,15 @@ class Indexables_Exclude_Taxonomy_Integration implements Integration_Interface {
*
* @param array $excluded_taxonomies The excluded taxonomies.
*
* @return array The excluded post types, including the specific post type.
* @return array The excluded taxonomies, including specific taxonomies.
*/
public function exclude_taxonomies_for_indexation( $excluded_taxonomies ) {
$taxonomies_to_exclude = \array_merge( $excluded_taxonomies, [ 'wp_pattern_category' ] );
if ( $this->options_helper->get( 'disable-post_format', false ) ) {
return \array_merge( $excluded_taxonomies, [ 'post_format' ] );
return \array_merge( $taxonomies_to_exclude, [ 'post_format' ] );
}
return $excluded_taxonomies;
return $taxonomies_to_exclude;
}
}

View File

@@ -135,6 +135,7 @@ class Link_Count_Columns_Integration implements Integration_Interface {
$columns[ 'wpseo-' . self::COLUMN_LINKS ] = \sprintf(
'<span class="yoast-linked-to yoast-column-header-has-tooltip" data-tooltip-text="%1$s"><span class="screen-reader-text">%2$s</span></span>',
\esc_attr__( 'Number of outgoing internal links in this post. See "Yoast Columns" text in the help tab for more info.', 'wordpress-seo' ),
/* translators: Hidden accessibility text. */
\esc_html__( 'Outgoing internal links', 'wordpress-seo' )
);
@@ -142,6 +143,7 @@ class Link_Count_Columns_Integration implements Integration_Interface {
$columns[ 'wpseo-' . self::COLUMN_LINKED ] = \sprintf(
'<span class="yoast-linked-from yoast-column-header-has-tooltip" data-tooltip-text="%1$s"><span class="screen-reader-text">%2$s</span></span>',
\esc_attr__( 'Number of internal links linking to this post. See "Yoast Columns" text in the help tab for more info.', 'wordpress-seo' ),
/* translators: Hidden accessibility text. */
\esc_html__( 'Received internal links', 'wordpress-seo' )
);
}

View File

@@ -207,6 +207,7 @@ class Workouts_Integration implements Integration_Interface {
);
$button = '<a class="yoast-button yoast-button-upsell yoast-button--small" href="' . \esc_url( $url ) . '" target="_blank">'
. \esc_html__( 'Renew your subscription', 'wordpress-seo' )
/* translators: Hidden accessibility text. */
. '<span class="screen-reader-text">' . \__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>'
. '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>'
. '</a>';
@@ -236,6 +237,7 @@ class Workouts_Integration implements Integration_Interface {
);
$button = '<a class="yoast-button yoast-button--primary yoast-button--small" href="' . \esc_url( $url_button ) . '" target="_blank">'
. \esc_html__( 'Get help activating your subscription', 'wordpress-seo' )
/* translators: Hidden accessibility text. */
. '<span class="screen-reader-text">' . \__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>'
. '</a>';
}
@@ -243,7 +245,7 @@ class Workouts_Integration implements Integration_Interface {
$notice = new Notice_Presenter(
$title,
$copy,
'Assistent_Time_bubble_500x570.png',
null,
$button
);

View File

@@ -0,0 +1,17 @@
<?php
namespace Yoast\WP\SEO\Integrations\Alerts;
/**
* Black_Friday_Product_Editor_Checklist_Notification class.
* @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
*/
class Black_Friday_Product_Editor_Checklist_Notification extends Abstract_Dismissable_Alert {
/**
* Holds the alert identifier.
*
* @var string
*/
protected $alert_identifier = 'black-friday-2023-product-editor-checklist';
}

View File

@@ -0,0 +1,16 @@
<?php
namespace Yoast\WP\SEO\Integrations\Alerts;
/**
* Black_Friday_Promotion_Notification class.
*/
class Black_Friday_Promotion_Notification extends Abstract_Dismissable_Alert {
/**
* Holds the alert identifier.
*
* @var string
*/
protected $alert_identifier = 'black-friday-2023-promotion';
}

View File

@@ -0,0 +1,16 @@
<?php
namespace Yoast\WP\SEO\Integrations\Alerts;
/**
* Black_Friday_Promo_Notification class.
*/
class Black_Friday_Sidebar_Checklist_Notification extends Abstract_Dismissable_Alert {
/**
* Holds the alert identifier.
*
* @var string
*/
protected $alert_identifier = 'black-friday-2023-sidebar-checklist';
}

View File

@@ -125,7 +125,7 @@ class Cleanup_Integration implements Integration_Interface {
return $this->cleanup_repository->update_indexables_author_to_reassigned( $limit );
},
'clean_orphaned_user_indexables_without_wp_user' => function ( $limit ) {
return $this->cleanup_repository->clean_indexables_for_object_type_and_source_table( 'users', 'ID', 'user', $limit );
return $this->cleanup_repository->clean_indexables_for_orphaned_users( $limit );
},
'clean_orphaned_user_indexables_without_wp_post' => function ( $limit ) {
return $this->cleanup_repository->clean_indexables_for_object_type_and_source_table( 'posts', 'ID', 'post', $limit );

View File

@@ -2,6 +2,7 @@
namespace Yoast\WP\SEO\Integrations;
use WP_HTML_Tag_Processor;
use WPSEO_Replace_Vars;
use Yoast\WP\SEO\Conditionals\Front_End_Conditional;
use Yoast\WP\SEO\Context\Meta_Tags_Context;
@@ -175,6 +176,20 @@ class Front_End_Integration implements Integration_Interface {
'Schema',
];
/**
* The next output.
*
* @var string
*/
protected $next;
/**
* The prev output.
*
* @var string
*/
protected $prev;
/**
* Returns the conditionals based on which this loadable should be active.
*
@@ -219,6 +234,8 @@ class Front_End_Integration implements Integration_Interface {
* to avoid duplicate and/or mismatched metadata.
*/
public function register_hooks() {
\add_filter( 'render_block', [ $this, 'query_loop_next_prev' ], 1, 2 );
\add_action( 'wp_head', [ $this, 'call_wpseo_head' ], 1 );
// Filter the title for compatibility with other plugins and themes.
\add_filter( 'wp_title', [ $this, 'filter_title' ], 15 );
@@ -262,6 +279,72 @@ class Front_End_Integration implements Integration_Interface {
return $title;
}
/**
* Filters the next and prev links in the query loop block.
*
* @param string $html The HTML output.
* @param array $block The block.
* @return string The filtered HTML output.
*/
public function query_loop_next_prev( $html, $block ) {
if ( $block['blockName'] === 'core/query' ) {
// Check that the query does not inherit the main query.
if ( isset( $block['attrs']['query']['inherit'] ) && ! $block['attrs']['query']['inherit'] ) {
\add_filter( 'wpseo_adjacent_rel_url', [ $this, 'adjacent_rel_url' ], 1, 3 );
}
}
if ( $block['blockName'] === 'core/query-pagination-next' ) {
$this->next = $html;
}
if ( $block['blockName'] === 'core/query-pagination-previous' ) {
$this->prev = $html;
}
return $html;
}
/**
* Returns correct adjacent pages when QUery loop block does not inherit query from template.
*
* @param string $link The current link.
* @param string $rel Link relationship, prev or next.
* @param Indexable_Presentation|null $presentation The indexable presentation.
*
* @return string The correct link.
*/
public function adjacent_rel_url( $link, $rel, $presentation = null ) {
if ( $link === \home_url( '/' ) ) {
return $link;
}
if ( $rel === 'next' || $rel === 'prev' ) {
// WP_HTML_Tag_Processor was introduced in WordPress 6.2.
if ( \class_exists( WP_HTML_Tag_Processor::class ) ) {
$processor = new WP_HTML_Tag_Processor( $this->$rel );
while ( $processor->next_tag( [ 'tag_name' => 'a' ] ) ) {
$href = $processor->get_attribute( 'href' );
if ( $href ) {
return $presentation->permalink . substr( $href, 1 );
}
}
}
// Remove else when dropping support for WordPress 6.1 and lower.
else {
$pattern = '/"(.*?)"/';
// Find all matches of the pattern in the HTML string.
\preg_match_all( $pattern, $this->$rel, $matches );
if ( isset( $matches[1] ) && isset( $matches[1][0] ) && $matches[1][0] ) {
return $presentation->permalink . \substr( $matches[1][0], 1 );
}
}
}
return $link;
}
/**
* Filters our robots presenter, but only when wp_robots is attached to the wp_head action.
*

View File

@@ -110,8 +110,15 @@ class Crawl_Cleanup_Basic implements Integration_Interface {
*/
public function resource_hints_plain_cleanup( $hints ) {
foreach ( $hints as $key => $hint ) {
if ( \strpos( $hint, '//s.w.org' ) !== false ) {
unset( $hints[ $key ] );
if ( \is_array( $hint ) && isset( $hint['href'] ) ) {
if ( \strpos( $hint['href'], '//s.w.org' ) !== false ) {
unset( $hints[ $key ] );
}
}
else {
if ( \strpos( $hint, '//s.w.org' ) !== false ) {
unset( $hints[ $key ] );
}
}
}

View File

@@ -182,13 +182,13 @@ class RSS_Footer_Embed implements Integration_Interface {
protected function get_link_template() {
/**
* Filter: 'nofollow_rss_links' - Allow the developer to determine whether or not to follow the links in
* the bits Yoast SEO adds to the RSS feed, defaults to true.
* the bits Yoast SEO adds to the RSS feed, defaults to false.
*
* @api bool $unsigned Whether or not to follow the links in RSS feed, defaults to true.
*
* @since 1.4.20
*/
if ( \apply_filters( 'nofollow_rss_links', true ) ) {
if ( \apply_filters( 'nofollow_rss_links', false ) ) {
return '<a rel="nofollow" href="%1$s">%2$s</a>';
}

View File

@@ -25,6 +25,8 @@ use Yoast\WP\SEO\Helpers\User_Helper;
use Yoast\WP\SEO\Helpers\Woocommerce_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Content_Type_Visibility\Application\Content_Type_Visibility_Dismiss_Notifications;
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
/**
* Class Settings_Integration.
@@ -88,6 +90,9 @@ class Settings_Integration implements Integration_Interface {
'deny_search_crawling',
'deny_wp_json_crawling',
'deny_adsbot_crawling',
'deny_ccbot_crawling',
'deny_google_extended_crawling',
'deny_gptbot_crawling',
],
];
@@ -364,6 +369,9 @@ class Settings_Integration implements Integration_Interface {
\wp_enqueue_media();
$this->asset_manager->enqueue_script( 'new-settings' );
$this->asset_manager->enqueue_style( 'new-settings' );
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
$this->asset_manager->enqueue_style( 'black-friday-banner' );
}
$this->asset_manager->localize_script( 'new-settings', 'wpseoScriptData', $this->get_script_data() );
}
@@ -453,9 +461,11 @@ class Settings_Integration implements Integration_Interface {
'isRtl' => \is_rtl(),
'isNetworkAdmin' => \is_network_admin(),
'isMainSite' => \is_main_site(),
'isMultisite' => \is_multisite(),
'isWooCommerceActive' => $this->woocommerce_helper->is_active(),
'isLocalSeoActive' => \defined( 'WPSEO_LOCAL_FILE' ),
'isNewsSeoActive' => \defined( 'WPSEO_NEWS_FILE' ),
'promotions' => YoastSEO()->classes->get( Promotion_Manager::class )->get_current_promotions(),
'siteUrl' => \get_bloginfo( 'url' ),
'siteTitle' => \get_bloginfo( 'name' ),
'sitemapUrl' => WPSEO_Sitemaps_Router::get_base_url( 'sitemap_index.xml' ),

View File

@@ -8,6 +8,7 @@ use Yoast\WP\SEO\Conditionals\User_Can_Manage_Wpseo_Options_Conditional;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
use Yoast\WP\SEO\Helpers\Product_Helper;
use Yoast\WP\SEO\Helpers\Short_Link_Helper;
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
/**
* Class Support_Integration.
@@ -130,6 +131,9 @@ class Support_Integration implements Integration_Interface {
\remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
$this->asset_manager->enqueue_script( 'support' );
$this->asset_manager->enqueue_style( 'support' );
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
$this->asset_manager->enqueue_style( 'black-friday-banner' );
}
$this->asset_manager->localize_script( 'support', 'wpseoScriptData', $this->get_script_data() );
}
@@ -152,16 +156,17 @@ class Support_Integration implements Integration_Interface {
*/
public function get_script_data() {
return [
'preferences' => [
'preferences' => [
'isPremium' => $this->product_helper->is_premium(),
'isRtl' => \is_rtl(),
'promotions' => YoastSEO()->classes->get( Promotion_Manager::class )->get_current_promotions(),
'pluginUrl' => \plugins_url( '', \WPSEO_FILE ),
'upsellSettings' => [
'actionId' => 'load-nfd-ctb',
'premiumCtbId' => 'f6a84663-465f-4cb5-8ba5-f7a6d72224b2',
],
],
'linkParams' => $this->shortlink_helper->get_query_params(),
'linkParams' => $this->shortlink_helper->get_query_params(),
];
}
}

View File

@@ -20,10 +20,13 @@ use WPSEO_Shortlinker;
use WPSEO_Utils;
use Yoast\WP\SEO\Actions\Alert_Dismissal_Action;
use Yoast\WP\SEO\Conditionals\Third_Party\Elementor_Edit_Conditional;
use Yoast\WP\SEO\Conditionals\WooCommerce_Conditional;
use Yoast\WP\SEO\Helpers\Capability_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Introductions\Infrastructure\Wistia_Embed_Permission_Repository;
use Yoast\WP\SEO\Presenters\Admin\Meta_Fields_Presenter;
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
/**
* Integrates the Yoast SEO metabox in the Elementor editor.
@@ -98,6 +101,13 @@ class Elementor implements Integration_Interface {
*/
protected $inclusive_language_analysis;
/**
* Holds the promotion manager.
*
* @var Promotion_Manager
*/
protected $promotion_manager;
/**
* Returns the conditionals based in which this loadable should be active.
*
@@ -113,15 +123,18 @@ class Elementor implements Integration_Interface {
* @param WPSEO_Admin_Asset_Manager $asset_manager The asset manager.
* @param Options_Helper $options The options helper.
* @param Capability_Helper $capability The capability helper.
* @param Promotion_Manager $promotion_manager The promotion manager.
*/
public function __construct(
WPSEO_Admin_Asset_Manager $asset_manager,
Options_Helper $options,
Capability_Helper $capability
Capability_Helper $capability,
Promotion_Manager $promotion_manager
) {
$this->asset_manager = $asset_manager;
$this->options = $options;
$this->capability = $capability;
$this->asset_manager = $asset_manager;
$this->options = $options;
$this->capability = $capability;
$this->promotion_manager = $promotion_manager;
$this->seo_analysis = new WPSEO_Metabox_Analysis_SEO();
$this->readability_analysis = new WPSEO_Metabox_Analysis_Readability();
@@ -401,6 +414,7 @@ class Elementor implements Integration_Interface {
$this->asset_manager->enqueue_style( 'scoring' );
$this->asset_manager->enqueue_style( 'monorepo' );
$this->asset_manager->enqueue_style( 'admin-css' );
$this->asset_manager->enqueue_style( 'ai-generator' );
$this->asset_manager->enqueue_style( 'elementor' );
$this->asset_manager->enqueue_script( 'admin-global' );
@@ -420,8 +434,7 @@ class Elementor implements Integration_Interface {
'has_taxonomies' => $this->current_post_type_has_taxonomies(),
],
'shortcodes' => [
'wpseo_filter_shortcodes_nonce' => \wp_create_nonce( 'wpseo-filter-shortcodes' ),
'wpseo_shortcode_tags' => $this->get_valid_shortcode_tags(),
'wpseo_shortcode_tags' => $this->get_valid_shortcode_tags(),
],
];
@@ -434,24 +447,31 @@ class Elementor implements Integration_Interface {
'enabled_features' => WPSEO_Utils::retrieve_enabled_features(),
];
$alert_dismissal_action = \YoastSEO()->classes->get( Alert_Dismissal_Action::class );
$dismissed_alerts = $alert_dismissal_action->all_dismissed();
$alert_dismissal_action = \YoastSEO()->classes->get( Alert_Dismissal_Action::class );
$dismissed_alerts = $alert_dismissal_action->all_dismissed();
$woocommerce_conditional = new WooCommerce_Conditional();
$script_data = [
'media' => [ 'choose_image' => \__( 'Use Image', 'wordpress-seo' ) ],
'metabox' => $this->get_metabox_script_data(),
'userLanguageCode' => WPSEO_Language_Utils::get_language( \get_user_locale() ),
'isPost' => true,
'isBlockEditor' => WP_Screen::get()->is_block_editor(),
'isElementorEditor' => true,
'postStatus' => \get_post_status( $post_id ),
'analysis' => [
'media' => [ 'choose_image' => \__( 'Use Image', 'wordpress-seo' ) ],
'metabox' => $this->get_metabox_script_data(),
'userLanguageCode' => WPSEO_Language_Utils::get_language( \get_user_locale() ),
'isPost' => true,
'isBlockEditor' => WP_Screen::get()->is_block_editor(),
'isElementorEditor' => true,
'isWooCommerceActive' => $woocommerce_conditional->is_met(),
'postStatus' => \get_post_status( $post_id ),
'postType' => \get_post_type( $post_id ),
'analysis' => [
'plugins' => $plugins_script_data,
'worker' => $worker_script_data,
],
'dismissedAlerts' => $dismissed_alerts,
'webinarIntroElementorUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/webinar-intro-elementor' ),
'usedKeywordsNonce' => \wp_create_nonce( 'wpseo-keyword-usage-and-post-types' ),
'dismissedAlerts' => $dismissed_alerts,
'webinarIntroElementorUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/webinar-intro-elementor' ),
'currentPromotions' => $this->promotion_manager->get_current_promotions(),
'usedKeywordsNonce' => \wp_create_nonce( 'wpseo-keyword-usage-and-post-types' ),
'linkParams' => WPSEO_Shortlinker::get_query_params(),
'pluginUrl' => \plugins_url( '', \WPSEO_FILE ),
'wistiaEmbedPermission' => \YoastSEO()->classes->get( Wistia_Embed_Permission_Repository::class )->get_value_for_user( \get_current_user_id() ),
];
if ( \post_type_supports( $this->get_metabox_post()->post_type, 'thumbnail' ) ) {

View File

@@ -89,10 +89,19 @@ class Wordproof implements Integration_Interface {
*/
\add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_assets' ], 10, 0 );
/**
* Add async to the wordproof scripts.
*/
\add_filter( 'script_loader_tag', [ $this, 'add_async_to_script' ], 10, 3 );
if ( version_compare( strtok( get_bloginfo( 'version' ), '-' ), '6.3', '>=' ) ) {
\add_action(
'wp_enqueue_scripts',
function() {
\wp_script_add_data( WPSEO_Admin_Asset_Manager::PREFIX . 'wordproof-uikit', 'strategy', 'async' );
},
11,
0
);
}
else {
\add_filter( 'script_loader_tag', [ $this, 'add_async_to_script' ], 10, 3 );
}
/**
* Removes the post meta timestamp key for the old privacy page.

View File

@@ -106,6 +106,11 @@ class Indexable_Attachment_Watcher implements Integration_Interface {
\delete_transient( Indexable_Post_Indexation_Action::UNINDEXED_COUNT_TRANSIENT );
\delete_transient( Indexable_Post_Indexation_Action::UNINDEXED_LIMITED_COUNT_TRANSIENT );
// Set this core option (introduced in WP 6.4) to ensure consistency.
if ( \get_option( 'wp_attachment_pages_enabled' ) !== false ) {
\update_option( 'wp_attachment_pages_enabled', (int) ! $new_value['disable-attachment'] );
}
switch ( $new_value['disable-attachment'] ) {
case false:
$this->indexing_helper->set_reason( Indexing_Reasons::REASON_ATTACHMENTS_MADE_ENABLED );

View File

@@ -99,7 +99,8 @@ class Indexable_Post_Type_Change_Watcher implements Integration_Interface {
return;
}
$public_post_types = \array_keys( $this->post_type_helper->get_public_post_types() );
$public_post_types = $this->post_type_helper->get_indexable_post_types();
$last_known_public_post_types = $this->options->get( 'last_known_public_post_types', [] );
// Initializing the option on the first run.
@@ -108,6 +109,7 @@ class Indexable_Post_Type_Change_Watcher implements Integration_Interface {
return;
}
// We look for new public post types.
$newly_made_public_post_types = \array_diff( $public_post_types, $last_known_public_post_types );
// We look for post types that from public have been made private.
@@ -122,7 +124,7 @@ class Indexable_Post_Type_Change_Watcher implements Integration_Interface {
$this->options->set( 'last_known_public_post_types', $public_post_types );
// There are new post types that have been made public.
if ( ! empty( $newly_made_public_post_types ) ) {
if ( $newly_made_public_post_types ) {
// Force a notification requesting to start the SEO data optimization.
\delete_transient( Indexable_Post_Indexation_Action::UNINDEXED_COUNT_TRANSIENT );
@@ -134,7 +136,7 @@ class Indexable_Post_Type_Change_Watcher implements Integration_Interface {
}
// There are post types that have been made private.
if ( ! empty( $newly_made_non_public_post_types ) ) {
if ( $newly_made_non_public_post_types ) {
// Schedule a cron job to remove all the posts whose post type has been made private.
$cleanup_not_yet_scheduled = ! \wp_next_scheduled( Cleanup_Integration::START_HOOK );
if ( $cleanup_not_yet_scheduled ) {

View File

@@ -101,7 +101,8 @@ class Indexable_Taxonomy_Change_Watcher implements Integration_Interface {
return;
}
$public_taxonomies = \array_keys( $this->taxonomy_helper->get_public_taxonomies() );
$public_taxonomies = $this->taxonomy_helper->get_indexable_taxonomies();
$last_known_public_taxonomies = $this->options->get( 'last_known_public_taxonomies', [] );
// Initializing the option on the first run.
@@ -112,6 +113,7 @@ class Indexable_Taxonomy_Change_Watcher implements Integration_Interface {
// We look for new public taxonomies.
$newly_made_public_taxonomies = \array_diff( $public_taxonomies, $last_known_public_taxonomies );
// We look fortaxonomies that from public have been made private.
$newly_made_non_public_taxonomies = \array_diff( $last_known_public_taxonomies, $public_taxonomies );

View File

@@ -0,0 +1,93 @@
<?php
namespace Yoast\WP\SEO\Introductions\Application;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Product_Helper;
use Yoast\WP\SEO\Introductions\Domain\Introduction_Interface;
/**
* Represents the introduction for the AI generate titles and introduction upsell.
*
* @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
*
* @makePublic
*/
class Ai_Generate_Titles_And_Descriptions_Introduction_Upsell implements Introduction_Interface {
use Current_Page_Trait;
use Version_Trait;
use User_Allowed_Trait;
/**
* Holds the product helper.
*
* @var \Yoast\WP\SEO\Helpers\Product_Helper
*/
private $product_helper;
/**
* Holds the options' helper.
*
* @var \Yoast\WP\SEO\Helpers\Options_Helper
*/
private $options_helper;
/**
* Constructs the introduction.
*
* @param \Yoast\WP\SEO\Helpers\Product_Helper $product_helper The product helper.
* @param \Yoast\WP\SEO\Helpers\Options_Helper $options_helper The options' helper.
*/
public function __construct(
Product_Helper $product_helper,
Options_Helper $options_helper
) {
$this->product_helper = $product_helper;
$this->options_helper = $options_helper;
}
/**
* Returns the unique name.
*
* @return string
*/
public function get_name() {
return 'ai-generate-titles-and-descriptions-upsell';
}
/**
* Returns the requested pagination priority. Lower means earlier.
*
* @return int
*/
public function get_priority() {
return 10;
}
/**
* Returns whether this introduction should show.
*
* @return bool
*/
public function should_show() {
if ( $this->product_helper->is_premium() ) {
return false;
}
if ( $this->options_helper->get( 'previous_version', '' ) === '' ) {
// The current installation is a new one (not upgraded yet).
return false;
}
if ( ! $this->is_version_between( $this->product_helper->get_version(), '20.11-RC4', '21.1-RC0' ) ) {
return false;
}
if ( ! $this->is_user_allowed( [ 'edit_posts' ] ) ) {
return false;
}
return true;
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace Yoast\WP\SEO\Introductions\Application;
trait Current_Page_Trait {
/**
* Determines whether the current page is applicable.
*
* @param string[] $pages The applicable pages.
*
* @return bool Whether the current page is applicable.
*/
private function is_on_yoast_page( $pages ) {
return \in_array( $this->get_page(), $pages, true );
}
/**
* Determines whether the current page is one of our installation pages.
*
* @return bool Whether the current page is one of our installation pages.
*/
private function is_on_installation_page() {
return $this->is_on_yoast_page( [ 'wpseo_installation_successful_free', 'wpseo_installation_successful' ] );
}
/**
* Retrieve the page variable.
*
* Note: the result is not safe to use in anything than strict comparisons!
*
* @return string The page variable.
*/
private function get_page() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
if ( isset( $_GET['page'] ) && \is_string( $_GET['page'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, only using it in strict comparison.
return \wp_unslash( $_GET['page'] );
}
return '';
}
}

View File

@@ -0,0 +1,113 @@
<?php
namespace Yoast\WP\SEO\Introductions\Application;
use Yoast\WP\SEO\Introductions\Domain\Introduction_Interface;
use Yoast\WP\SEO\Introductions\Domain\Introduction_Item;
use Yoast\WP\SEO\Introductions\Domain\Introductions_Bucket;
/**
* Manages the collection of introductions.
*
* @makePublic
*/
class Introductions_Collector {
/**
* Holds all the introductions.
*
* @var Introduction_Interface[]
*/
private $introductions;
/**
* Constructs the collector.
*
* @param Introduction_Interface ...$introductions All the introductions.
*/
public function __construct( Introduction_Interface ...$introductions ) {
$this->introductions = $this->add_introductions( ...$introductions );
}
/**
* Gets the data for the introductions.
*
* @param int $user_id The user ID.
*
* @return array The list of introductions.
*/
public function get_for( $user_id ) {
$bucket = new Introductions_Bucket();
$metadata = $this->get_metadata( $user_id );
foreach ( $this->introductions as $introduction ) {
if ( ! $introduction->should_show() ) {
continue;
}
if ( $this->is_seen( $introduction->get_name(), $metadata ) ) {
continue;
}
$bucket->add_introduction(
new Introduction_Item( $introduction->get_name(), $introduction->get_priority() )
);
}
return $bucket->to_array();
}
/**
* Filters introductions with the 'wpseo_introductions' filter.
*
* @param Introduction_Interface ...$introductions The introductions.
*
* @return Introduction_Interface[]
*/
private function add_introductions( Introduction_Interface ...$introductions ) {
/**
* Filter: Adds the possibility to add additional introductions to be included.
*
* @internal
* @api Introduction_Interface This filter expects a list of Introduction_Interface instances and expects only Introduction_Interface implementations to be added to the list.
*/
$filtered_introductions = (array) \apply_filters( 'wpseo_introductions', $introductions );
return \array_filter(
$filtered_introductions,
static function ( $introduction ) {
return \is_a( $introduction, Introduction_Interface::class );
}
);
}
/**
* Retrieves the introductions metadata for the user.
*
* @param int $user_id The user ID.
*
* @return array The introductions' metadata.
*/
private function get_metadata( $user_id ) {
$metadata = \get_user_meta( $user_id, '_yoast_wpseo_introductions', true );
if ( \is_array( $metadata ) ) {
return $metadata;
}
return [];
}
/**
* Determines whether the user has seen the introduction.
*
* @param string $name The name.
* @param string[] $metadata The metadata.
*
* @return bool Whether the user has seen the introduction.
*/
private function is_seen( $name, $metadata ) {
if ( \array_key_exists( $name, $metadata ) ) {
return (bool) $metadata[ $name ];
}
return false;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Yoast\WP\SEO\Introductions\Application;
trait User_Allowed_Trait {
/**
* Determines whether the user has the required capabilities.
*
* @param string[] $capabilities The required capabilities.
*
* @return bool Whether the user has the required capabilities.
*/
private function is_user_allowed( $capabilities ) {
foreach ( $capabilities as $capability ) {
if ( ! \current_user_can( $capability ) ) {
return false;
}
}
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace Yoast\WP\SEO\Introductions\Application;
trait Version_Trait {
/**
* Determines whether the version is between a min (inclusive) and max (exclusive).
*
* @param string $version The version to compare.
* @param string $min_version The minimum version.
* @param string $max_version The maximum version.
*
* @return bool Whether the version is between a min and max.
*/
private function is_version_between( $version, $min_version, $max_version ) {
return (
\version_compare( $version, $min_version, '>=' ) &&
\version_compare( $version, $max_version, '<' )
);
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Yoast\WP\SEO\Introductions\Domain;
/**
* Represents an introduction.
*/
interface Introduction_Interface {
/**
* Returns the unique name.
*
* @return string
*/
public function get_name();
/**
* Returns the requested pagination priority. Lower means earlier.
*
* @return int
*/
public function get_priority();
/**
* Returns whether this introduction should show.
*
* @return bool
*/
public function should_show();
}

View File

@@ -0,0 +1,64 @@
<?php
namespace Yoast\WP\SEO\Introductions\Domain;
/**
* Domain object that holds introduction information.
*/
class Introduction_Item {
/**
* The unique name.
*
* @var string
*/
private $name;
/**
* The priority.
*
* @var int
*/
private $priority;
/**
* Constructs the instance.
*
* @param string $name The unique name.
* @param int $priority The priority.
*/
public function __construct( $name, $priority ) {
$this->name = $name;
$this->priority = $priority;
}
/**
* Returns an array representation of the data.
*
* @return array Returns in an array format.
*/
public function to_array() {
return [
'name' => $this->get_name(),
'priority' => $this->get_priority(),
];
}
/**
* Returns the unique name.
*
* @return string
*/
public function get_name() {
return $this->name;
}
/**
* Returns the requested pagination priority. Higher means earlier.
*
* @return int
*/
public function get_priority() {
return $this->priority;
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace Yoast\WP\SEO\Introductions\Domain;
/**
* A collection domain object.
*/
class Introductions_Bucket {
/**
* Holds the introductions.
*
* @var Introduction_Item[]
*/
private $introductions;
/**
* The constructor.
*/
public function __construct() {
$this->introductions = [];
}
/**
* Adds an introduction to this bucket.
*
* @param Introduction_Item $introduction The introduction.
*
* @return void
*/
public function add_introduction( Introduction_Item $introduction ) {
$this->introductions[] = $introduction;
}
/**
* Returns the array representation of the introductions.
*
* @return array
*/
public function to_array() {
// No sorting here because that is done in JS.
return \array_map(
static function ( $item ) {
return $item->to_array();
},
$this->introductions
);
}
}

View File

@@ -0,0 +1,80 @@
<?php
namespace Yoast\WP\SEO\Introductions\Infrastructure;
use Exception;
use Yoast\WP\SEO\Helpers\User_Helper;
/**
* Takes care of the get/set in the WP user meta.
*
* @makePublic
*/
class Wistia_Embed_Permission_Repository {
const USER_META_KEY = '_yoast_wpseo_wistia_embed_permission';
const DEFAULT_VALUE = false;
/**
* Holds the User_Helper instance.
*
* @var User_Helper
*/
private $user_helper;
/**
* Constructs the class.
*
* @param User_Helper $user_helper The User_Helper.
*/
public function __construct( User_Helper $user_helper ) {
$this->user_helper = $user_helper;
}
/**
* Retrieves the current value for a user.
*
* @param int $user_id User ID.
*
* @throws Exception If an invalid user ID is supplied.
*
* @return bool The current value.
*/
public function get_value_for_user( $user_id ) {
$value = $this->user_helper->get_meta( $user_id, self::USER_META_KEY, true );
if ( $value === false ) {
throw new Exception( 'Invalid User ID' );
}
if ( $value === '0' || $value === '1' ) {
// The value is stored as a string because otherwise we can not see the difference between false and an invalid user ID.
return $value === '1';
}
/**
* Why could $value be invalid?
* - When the database row does not exist yet, $value can be an empty string.
* - Faulty data was stored?
*/
return self::DEFAULT_VALUE;
}
/**
* Sets the Wistia embed permission value for the current user.
*
* @param int $user_id The user ID.
* @param bool $value The value.
*
* @throws Exception If an invalid user ID is supplied.
*
* @return bool Whether the update was successful.
*/
public function set_value_for_user( $user_id, $value ) {
// The value is stored as a string because otherwise we can not see the difference between false and an invalid user ID.
$value_as_string = ( $value === true ) ? '1' : '0';
// Checking for only false, not interested in not having to update.
return $this->user_helper->update_meta( $user_id, self::USER_META_KEY, $value_as_string ) !== false;
}
}

View File

@@ -0,0 +1,25 @@
# Introductions
Is for showing introductions to a user, on Yoast admin pages.
Based on plugin version, page, user capabilities and whether the user has seen it already.
- `Introduction_Interface` defines what data is needed
- `name` as unique identifier
- `plugin` and `version` to determine if the introduction is new (version > plugin version)
- `pages` to be able to only show on certain Yoast admin pages
- `capabilities` to be able to only show for certain users
- `Introductions_Collector` uses that data to determine whether an introduction should be "shown" to a user
- uses the `wpseo_introductions` filter to be extendable from our other plugins
- uses `_yoast_introductions` user metadata to determine if the user saw an introduction already
- `Introduction_Bucket` and `Introduction_Item` are used by the collector to get an array
- `Introductions_Integration` runs on the Yoast Admin pages and loads the assets
- only loads on our Yoast admin pages, but never on our installation success pages as to not disturb onboarding
- only loads assets if there is an introduction to show
- `js/src/introductions` holds the JS
- `wpseoIntroductions` is the localized script to transfer data from PHP to JS
- `css/src/ai-generator.css` holds the CSS
Inside JS, register the modal content via `window.YoastSEO._registerIntroductionComponent`, which takes a
`name` and a `Component`. The name needs to be the same as the name in the `Introduction_Interface`.
The action `yoast.introductions.ready` can be used to know whether the registration function is available and ready for
use.

View File

@@ -0,0 +1,160 @@
<?php
namespace Yoast\WP\SEO\Introductions\User_Interface;
use WPSEO_Admin_Asset_Manager;
use Yoast\WP\SEO\Conditionals\Admin\Yoast_Admin_Conditional;
use Yoast\WP\SEO\Helpers\Product_Helper;
use Yoast\WP\SEO\Helpers\Short_Link_Helper;
use Yoast\WP\SEO\Helpers\User_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Introductions\Application\Current_Page_Trait;
use Yoast\WP\SEO\Introductions\Application\Introductions_Collector;
use Yoast\WP\SEO\Introductions\Infrastructure\Wistia_Embed_Permission_Repository;
/**
* Loads introduction modal scripts, when there are applicable introductions.
*/
class Introductions_Integration implements Integration_Interface {
use Current_Page_Trait;
const SCRIPT_HANDLE = 'introductions';
/**
* Holds the admin asset manager.
*
* @var WPSEO_Admin_Asset_Manager
*/
private $admin_asset_manager;
/**
* Holds the introduction collector.
*
* @var Introductions_Collector
*/
private $introductions_collector;
/**
* Holds the product helper.
*
* @var Product_Helper
*/
private $product_helper;
/**
* Holds the user helper.
*
* @var User_Helper
*/
private $user_helper;
/**
* Holds the short link helper.
*
* @var Short_Link_Helper
*/
private $short_link_helper;
/**
* Holds the repository.
*
* @var Wistia_Embed_Permission_Repository
*/
private $wistia_embed_permission_repository;
/**
* Returns the conditionals based in which this loadable should be active.
*
* In this case: when on an admin page.
*/
public static function get_conditionals() {
return [ Yoast_Admin_Conditional::class ];
}
/**
* Constructs the integration.
*
* @param WPSEO_Admin_Asset_Manager $admin_asset_manager The admin asset manager.
* @param Introductions_Collector $introductions_collector The introductions' collector.
* @param Product_Helper $product_helper The product helper.
* @param User_Helper $user_helper The user helper.
* @param Short_Link_Helper $short_link_helper The short link helper.
* @param Wistia_Embed_Permission_Repository $wistia_embed_permission_repository The repository.
*/
public function __construct(
WPSEO_Admin_Asset_Manager $admin_asset_manager,
Introductions_Collector $introductions_collector,
Product_Helper $product_helper,
User_Helper $user_helper,
Short_Link_Helper $short_link_helper,
Wistia_Embed_Permission_Repository $wistia_embed_permission_repository
) {
$this->admin_asset_manager = $admin_asset_manager;
$this->introductions_collector = $introductions_collector;
$this->product_helper = $product_helper;
$this->user_helper = $user_helper;
$this->short_link_helper = $short_link_helper;
$this->wistia_embed_permission_repository = $wistia_embed_permission_repository;
}
/**
* Registers the action to enqueue the needed script(s).
*
* @return void
*/
public function register_hooks() {
if ( $this->is_on_installation_page() ) {
return;
}
\add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
}
/**
* Enqueue the new features assets.
*/
public function enqueue_assets() {
$user_id = $this->user_helper->get_current_user_id();
$introductions = $this->introductions_collector->get_for( $user_id );
if ( ! $introductions ) {
// Bail when there are no introductions to show.
return;
}
// Update user meta to have "seen" these introductions.
$this->update_user_introductions( $user_id, $introductions );
$this->admin_asset_manager->enqueue_script( self::SCRIPT_HANDLE );
$this->admin_asset_manager->localize_script(
self::SCRIPT_HANDLE,
'wpseoIntroductions',
[
'introductions' => $introductions,
'isPremium' => $this->product_helper->is_premium(),
'isRtl' => \is_rtl(),
'linkParams' => $this->short_link_helper->get_query_params(),
'pluginUrl' => \plugins_url( '', \WPSEO_FILE ),
'wistiaEmbedPermission' => $this->wistia_embed_permission_repository->get_value_for_user( $user_id ),
]
);
$this->admin_asset_manager->enqueue_style( 'introductions' );
}
/**
* Updates the user metadata to have "seen" the introductions.
*
* @param int $user_id The user ID.
* @param array $introductions The introductions.
*
* @return void
*/
private function update_user_introductions( $user_id, $introductions ) {
$metadata = $this->user_helper->get_meta( $user_id, '_yoast_wpseo_introductions', true );
if ( ! \is_array( $metadata ) ) {
$metadata = [];
}
foreach ( $introductions as $introduction ) {
$metadata[ $introduction['name'] ] = true;
}
$this->user_helper->update_meta( $user_id, '_yoast_wpseo_introductions', $metadata );
}
}

View File

@@ -0,0 +1,156 @@
<?php
namespace Yoast\WP\SEO\Introductions\User_Interface;
use Exception;
use WP_Error;
use WP_REST_Request;
use WP_REST_Response;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
use Yoast\WP\SEO\Helpers\User_Helper;
use Yoast\WP\SEO\Introductions\Infrastructure\Wistia_Embed_Permission_Repository;
use Yoast\WP\SEO\Main;
use Yoast\WP\SEO\Routes\Route_Interface;
/**
* Registers a route to offer get/set of the wistia embed permission for a user.
*
* @makePublic
*/
class Wistia_Embed_Permission_Route implements Route_Interface {
use No_Conditionals;
/**
* Represents the prefix.
*
* @var string
*/
const ROUTE_PREFIX = '/wistia_embed_permission';
/**
* Holds the repository.
*
* @var Wistia_Embed_Permission_Repository
*/
private $wistia_embed_permission_repository;
/**
* Holds the user helper.
*
* @var User_Helper
*/
private $user_helper;
/**
* Constructs the class.
*
* @param Wistia_Embed_Permission_Repository $wistia_embed_permission_repository The repository.
* @param User_Helper $user_helper The user helper.
*/
public function __construct(
Wistia_Embed_Permission_Repository $wistia_embed_permission_repository,
User_Helper $user_helper
) {
$this->wistia_embed_permission_repository = $wistia_embed_permission_repository;
$this->user_helper = $user_helper;
}
/**
* Registers routes with WordPress.
*
* @return void
*/
public function register_routes() {
\register_rest_route(
Main::API_V1_NAMESPACE,
self::ROUTE_PREFIX,
[
[
'methods' => 'GET',
'callback' => [ $this, 'get_wistia_embed_permission' ],
'permission_callback' => [ $this, 'permission_edit_posts' ],
],
[
'methods' => 'POST',
'callback' => [ $this, 'set_wistia_embed_permission' ],
'permission_callback' => [ $this, 'permission_edit_posts' ],
'args' => [
'value' => [
'required' => false,
'type' => 'bool',
'default' => true,
],
],
],
]
);
}
/**
* Gets the value of the wistia embed permission.
*
* @return WP_REST_Response|WP_Error The response, or an error.
*/
public function get_wistia_embed_permission() {
try {
$user_id = $this->user_helper->get_current_user_id();
$value = $this->wistia_embed_permission_repository->get_value_for_user( $user_id );
} catch ( Exception $exception ) {
return new WP_Error(
'wpseo_wistia_embed_permission_error',
$exception->getMessage(),
(object) []
);
}
return new WP_REST_Response(
[
'json' => (object) [
'value' => $value,
],
]
);
}
/**
* Sets the value of the wistia embed permission.
*
* @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 ) {
$params = $request->get_json_params();
$value = \boolval( $params['value'] );
try {
$user_id = $this->user_helper->get_current_user_id();
$result = $this->wistia_embed_permission_repository->set_value_for_user( $user_id, $value );
} catch ( Exception $exception ) {
return new WP_Error(
'wpseo_wistia_embed_permission_error',
$exception->getMessage(),
(object) []
);
}
return new WP_REST_Response(
[
'json' => (object) [
'success' => $result,
],
],
( $result ) ? 200 : 400
);
}
/**
* Permission callback.
*
* @return bool True when user has 'edit_posts' permission.
*/
public function permission_edit_posts() {
return \current_user_can( 'edit_posts' );
}
}

View File

@@ -72,7 +72,8 @@ class Help_Link_Presenter extends Abstract_Presenter {
if ( $this->opens_in_new_browser_tab ) {
$target_blank_attribute = ' target="_blank"';
$new_tab_message = ' ' . \__( '(Opens in a new browser tab)', 'wordpress-seo' );
/* translators: Hidden accessibility text. */
$new_tab_message = ' ' . \__( '(Opens in a new browser tab)', 'wordpress-seo' );
}
return \sprintf(

View File

@@ -4,6 +4,7 @@ namespace Yoast\WP\SEO\Presenters\Admin;
use WPSEO_Shortlinker;
use Yoast\WP\SEO\Presenters\Abstract_Presenter;
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
/**
* Presenter class for the Yoast SEO sidebar.
@@ -16,6 +17,8 @@ class Sidebar_Presenter extends Abstract_Presenter {
* @return string The sidebar HTML.
*/
public function present() {
$title = \__( 'BLACK FRIDAY - 30% OFF', 'wordpress-seo' );
$assets_uri = \trailingslashit( \plugin_dir_url( \WPSEO_FILE ) );
$buy_yoast_seo_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/jj' );
\ob_start();
@@ -42,6 +45,13 @@ class Sidebar_Presenter extends Abstract_Presenter {
sizes="(min-width: 1321px) 75px">
</figure>
</figure>
<?php if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) : ?>
<div class="sidebar__sale_banner_container">
<div class="sidebar__sale_banner">
<span class="banner_text"><?php echo \esc_html( $title ); ?></span>
</div>
</div>
<?php endif; ?>
<h2 class="yoast-get-premium-title">
<?php
/* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
@@ -50,31 +60,45 @@ class Sidebar_Presenter extends Abstract_Presenter {
</h2>
<p>
<?php
/* translators: %1$s expands to an opening strong tag, %2$s expands to a closing strong tag */
\printf( \esc_html__( 'Be the first to get %1$snew features & tools%2$s, before everyone else. Get %1$s 24/7 support%2$s and boost your websites visibility.', 'wordpress-seo' ), '<strong>', '</strong>' );
echo \esc_html__( 'Use AI to generate titles and meta descriptions, automatically redirect deleted pages, get 24/7 support and much, much more!', 'wordpress-seo' );
?>
</p>
<?php if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) : ?>
<div class="sidebar__sale_text">
<p>
<?php
/* translators: %1$s expands to an opening strong tag, %2$s expands to a closing strong tag */
\printf( \esc_html__( '%1$s SAVE 30%% %2$s on your 12 month subscription', 'wordpress-seo' ), '<strong>', '</strong>' );
?>
</p>
</div>
<?php endif; ?>
<p class="plugin-buy-button">
<a class="yoast-button-upsell" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" target="_blank" href="<?php echo \esc_url( $buy_yoast_seo_shortlink ); ?>">
<?php
/* translators: %s expands to Yoast SEO Premium */
\printf( \esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
echo \esc_html__( 'Claim your 30% off now!', 'wordpress-seo' );
}
else {
/* translators: %s expands to Yoast SEO Premium */
\printf( \esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
}
?>
<span aria-hidden="true" class="yoast-button-upsell__caret"></span>
</a>
</p>
<div class="review-container">
<a href="https://www.g2.com/products/yoast-yoast/reviews" target="_blank" rel="noopener">
<h3 class="title">
<span class="claim">
<?php \esc_html_e( 'Read reviews from real users', 'wordpress-seo' ); ?>
</h3>
</span>
<span class="rating">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/logo-g2-white.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-half.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/g2_logo_white_optm.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
<img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-half.svg' ); ?>">
<span class="rating-text">4.6 / 5</span>
</span>

View File

@@ -0,0 +1,27 @@
<?php
namespace Yoast\WP\SEO\Promotions\Application;
/**
* Interface for the promotion manager.
*
* @makePublic
*/
interface Promotion_Manager_Interface {
/**
* Whether the promotion is effective.
*
* @param string $promotion_name The name of the promotion.
*
* @return bool Whether the promotion is effective.
*/
public function is( string $promotion_name ) : bool;
/**
* Get the list of promotions.
*
* @return array The list of promotions.
*/
public function get_promotions_list() : array;
}

View File

@@ -0,0 +1,74 @@
<?php
namespace Yoast\WP\SEO\Promotions\Application;
use Yoast\WP\SEO\Promotions\Domain\Promotion_Interface;
/**
* Class to manage promotional promotions.
*
* @makePublic
*/
class Promotion_Manager implements Promotion_Manager_Interface {
/**
* The centralized list of promotions: all promotions should be passed to the constructor.
*
* @var array<Abstract_Promotion>
*/
private $promotions_list = [];
/**
* Class constructor.
*
* @param Promotion_Interface ...$promotions list of promotions.
*/
public function __construct( Promotion_Interface ...$promotions ) {
$this->promotions_list = $promotions;
}
/**
* Whether the promotion is effective.
*
* @param string $promotion_name The name of the promotion.
*
* @return bool Whether the promotion is effective.
*/
public function is( string $promotion_name ) : bool {
$time = \time();
foreach ( $this->promotions_list as $promotion ) {
if ( $promotion->get_promotion_name() === $promotion_name ) {
return $promotion->get_time_interval()->contains( $time );
}
}
return false;
}
/**
* Get the list of promotions.
*
* @return array<Abstract_Promotion> The list of promotions.
*/
public function get_promotions_list() : array {
return $this->promotions_list;
}
/**
* Get the names of currently active promotions.
*
* @return array<string> The list of promotions.
*/
public function get_current_promotions() : array {
$current_promotions = [];
$time = \time();
foreach ( $this->promotions_list as $promotion ) {
if ( $promotion->get_time_interval()->contains( $time ) ) {
$current_promotions[] = $promotion->get_promotion_name();
}
}
return $current_promotions;
}
}

View File

@@ -0,0 +1,52 @@
<?php
namespace Yoast\WP\SEO\Promotions\Domain;
/**
* Abstract class for a promotion.
*/
abstract class Abstract_Promotion implements Promotion_Interface {
/**
* The promotion name.
*
* @var string
*/
private $promotion_name;
/**
* The time interval in which the promotion is active.
*
* @var Time_Interval
*/
private $time_interval;
/**
* Class constructor.
*
* @param string $promotion_name The promotion name.
* @param Time_Interval $time_interval The time interval in which the promotion is active.
*/
public function __construct( string $promotion_name, Time_Interval $time_interval ) {
$this->promotion_name = $promotion_name;
$this->time_interval = $time_interval;
}
/**
* Returns the promotion name.
*
* @return string
*/
public function get_promotion_name() {
return $this->promotion_name;
}
/**
* Returns the time interval in which the promotion is active.
*
* @return Time_Interval
*/
public function get_time_interval() {
return $this->time_interval;
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Yoast\WP\SEO\Promotions\Domain;
/**
* Class to manage the Black Friday checklist promotion.
*
* @makePublic
*/
class Black_Friday_Checklist_Promotion extends Abstract_Promotion implements Promotion_Interface {
/**
* Class constructor.
*/
public function __construct() {
parent::__construct(
'black-friday-2023-checklist',
new Time_Interval(
\gmmktime( 11, 00, 00, 9, 19, 2023 ),
\gmmktime( 11, 00, 00, 10, 31, 2023 )
)
);
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Yoast\WP\SEO\Promotions\Domain;
/**
* Class to manage the Black Friday promotion.
*
* @makePublic
*/
class Black_Friday_Promotion extends Abstract_Promotion implements Promotion_Interface {
/**
* Class constructor.
*/
public function __construct() {
parent::__construct(
'black-friday-2023-promotion',
new Time_Interval( \gmmktime( 11, 00, 00, 11, 23, 2023 ), \gmmktime( 11, 00, 00, 11, 28, 2023 ) )
);
}
}

View File

@@ -0,0 +1,8 @@
<?php
namespace Yoast\WP\SEO\Promotions\Domain;
/**
* Interface for a Promotion.
*/
interface Promotion_Interface {}

View File

@@ -0,0 +1,71 @@
<?php
namespace Yoast\WP\SEO\Promotions\Domain;
/**
* Class Time_Interval
*
* Value object for a time interval.
*/
class Time_Interval {
/**
* The starting time of the interval as a Unix timestamp.
*
* @var int
*/
public $time_start;
/**
* The ending time of the interval as a Unix timestamp.
*
* @var int
*/
public $time_end;
/**
* Time_Interval constructor.
*
* @codeCoverageIgnore
*
* @param int $time_start Interval start time.
* @param int $time_end Interval end time.
*/
public function __construct( int $time_start, int $time_end ) {
$this->time_start = $time_start;
$this->time_end = $time_end;
}
/**
* Checks if the given time is within the interval.
*
* @param int $time The time to check.
*
* @return bool Whether the given time is within the interval.
*/
public function contains( int $time ): bool {
return ( ( $time > $this->time_start ) && ( $time < $this->time_end ) );
}
/**
* Sets the interval astarting date.
*
* @param int $time_start The interval start time.
*
* @return void
*/
public function set_start_date( int $time_start ) {
$this->time_start = $time_start;
}
/**
* Sets the interval ending date.
*
* @param int $time_end The interval end time.
*
* @return void
*/
public function set_end_date( int $time_end ) {
$this->time_end = $time_end;
}
}

View File

@@ -495,6 +495,44 @@ class Indexable_Cleanup_Repository {
return $wpdb->query( "DELETE FROM $indexable_table WHERE object_type = '{$object_type}' AND object_id IN( " . \implode( ',', $orphans ) . ' )' );
}
/**
* Deletes rows from the indexable table where the source is no longer there.
*
* @param int $limit The limit we'll apply to the delete query.
*
* @return int|bool The number of rows that was deleted or false if the query failed.
*/
public function clean_indexables_for_orphaned_users( $limit ) {
global $wpdb;
$indexable_table = Model::get_table_name( 'Indexable' );
$source_table = $wpdb->users;
// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: There is no unescaped user input.
$query = $wpdb->prepare(
"
SELECT indexable_table.object_id
FROM {$indexable_table} indexable_table
LEFT JOIN {$source_table} AS source_table
ON indexable_table.object_id = source_table.ID
WHERE source_table.ID IS NULL
AND indexable_table.object_id IS NOT NULL
AND indexable_table.object_type = 'user'
LIMIT %d",
$limit
);
// phpcs:enable
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
$orphans = $wpdb->get_col( $query );
if ( empty( $orphans ) ) {
return 0;
}
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
return $wpdb->query( "DELETE FROM $indexable_table WHERE object_type = 'user' AND object_id IN( " . \implode( ',', $orphans ) . ' )' );
}
/**
* Counts indexables for given source table + source identifier + object type.
*
@@ -508,8 +546,8 @@ class Indexable_Cleanup_Repository {
global $wpdb;
$indexable_table = Model::get_table_name( 'Indexable' );
$source_table = $wpdb->prefix . $source_table;
// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: There is no unescaped user input.
$query = $wpdb->prepare(
// phpcs:disable WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
return $wpdb->get_col(
"
SELECT count(*)
FROM {$indexable_table} indexable_table
@@ -518,11 +556,31 @@ class Indexable_Cleanup_Repository {
WHERE source_table.{$source_identifier} IS NULL
AND indexable_table.object_id IS NOT NULL
AND indexable_table.object_type = '{$object_type}'"
);
)[0];
// phpcs:enable
}
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
return $wpdb->get_col( $query )[0];
/**
* Counts indexables for orphaned users.
*
* @return mixed
*/
public function count_indexables_for_orphaned_users() {
global $wpdb;
$indexable_table = Model::get_table_name( 'Indexable' );
$source_table = $wpdb->users;
//phpcs:disable WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
return $wpdb->get_col(
"
SELECT count(*)
FROM {$indexable_table} indexable_table
LEFT JOIN {$source_table} AS source_table
ON indexable_table.object_id = source_table.ID
WHERE source_table.ID IS NULL
AND indexable_table.object_id IS NOT NULL
AND indexable_table.object_type = 'user'"
)[0];
// phpcs:enable
}
/**
@@ -581,8 +639,8 @@ class Indexable_Cleanup_Repository {
$indexable_table = Model::get_table_name( 'Indexable' );
// Warning: If this query is changed, make sure to update the query in cleanup_orphaned_from_table in Premium as well.
// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: There is no unescaped user input.
$query = $wpdb->prepare(
// phpcs:disable WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
return $wpdb->get_col(
"
SELECT count(*)
FROM {$table} table_to_clean
@@ -590,11 +648,8 @@ class Indexable_Cleanup_Repository {
ON table_to_clean.{$column} = indexable_table.id
WHERE indexable_table.id IS NULL
AND table_to_clean.{$column} IS NOT NULL"
);
)[0];
// phpcs:enable
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
return $wpdb->get_col( $query )[0];
}
/**
@@ -606,7 +661,7 @@ class Indexable_Cleanup_Repository {
* @return int|bool The number of updated rows, false if query to get data fails.
*/
public function update_indexables_author_to_reassigned( $limit ) {
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
$reassigned_authors_objs = $this->get_reassigned_authors( $limit );
if ( $reassigned_authors_objs === false ) {

View File

@@ -0,0 +1,54 @@
<?php
namespace Yoast\WP\SEO\User_Profiles_Additions\User_Interface;
use Yoast\WP\SEO\Conditionals\User_Profile_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;
/**
* Adds a new hook in the user profiles edit screen to add content.
*/
class User_Profiles_Additions_Ui implements Integration_Interface {
/**
* Returns the conditionals based in which this loadable should be active.
*
* @return array
*/
public static function get_conditionals() {
return [ User_Profile_Conditional::class ];
}
/**
* Initializes the integration.
*
* This is the place to register hooks and filters.
*
* @return void
*/
public function register_hooks() {
\add_action( 'show_user_profile', [ $this, 'add_hook_to_user_profile' ] );
\add_action( 'edit_user_profile', [ $this, 'add_hook_to_user_profile' ] );
}
/**
* Add the inputs needed for SEO values to the User Profile page.
*
* @param WP_User $user User instance to output for.
*/
public function add_hook_to_user_profile( $user ) {
echo '<div class="yoast yoast-settings">';
/**
* Fires in the user profile.
*
* @internal
*
* @param \WP_User $user The current WP_User object.
*/
\do_action( 'wpseo_user_profile_additions', $user );
echo '</div>';
}
}