Merged in MAW-865-auto-patch (pull request #27)
Plugin updates * Plugin updates search-filter-divi,woocommerce,wordpress-seo,search-filter-pro
This commit is contained in:
@@ -1,93 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Yoast I18n module.
|
||||
*
|
||||
* @package Yoast\I18n-module
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class defines a promo box and checks your translation site's API for stats about it,
|
||||
* then shows them to the user.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
* @phpcs:disable PEAR.NamingConventions.ValidClassName.Invalid
|
||||
*/
|
||||
class Yoast_I18n_v3 {
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param array $args Contains the settings for the class.
|
||||
* @param bool $show_translation_box Whether the translation box should be shown.
|
||||
*/
|
||||
public function __construct( $args, $show_translation_box = true ) {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the language is en_US.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $language The language to check.
|
||||
*
|
||||
* @return bool Returns true if the language is en_US.
|
||||
*/
|
||||
protected function is_default_language( $language ) {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the i18n_promo message from the i18n_module. Returns en empty string if the promo shouldn't be shown.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return string The i18n promo message.
|
||||
*/
|
||||
public function get_promo_message() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a button that can be used to dismiss the i18n-message.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_dismiss_i18n_message_button() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs a promo box.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function promo() {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
}
|
||||
|
||||
/**
|
||||
* The API URL to use when requesting translation information.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $api_url The new API URL.
|
||||
*/
|
||||
public function set_api_url( $api_url ) {
|
||||
_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals;
|
||||
|
||||
/**
|
||||
* Conditional that is only met when The Events Calendar exists.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class The_Events_Calendar_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Returns whether this conditional is met.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return bool Whether the conditional is met.
|
||||
*/
|
||||
public function is_met() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is met when the CoAuthors Plus plugin is installed and activated.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class CoAuthors_Plus_Activated_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Checks if the CoAuthors Plus plugin is installed and activated.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return bool `true` when the CoAuthors Plus plugin is installed and activated.
|
||||
*/
|
||||
public function is_met() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return \defined( 'COAUTHORS_PLUS_VERSION' );
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Feature_Flag_Conditional;
|
||||
|
||||
/**
|
||||
* Feature flag conditional for the CoAuthors Plus integration.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class CoAuthors_Plus_Flag_Conditional extends Feature_Flag_Conditional {
|
||||
|
||||
/**
|
||||
* Returns the name of the CoAuthors Plus integration feature flag.
|
||||
*
|
||||
* @return string The name of the feature flag.
|
||||
*/
|
||||
protected function get_feature_flag() {
|
||||
return 'COAUTHORS_PLUS';
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Generators\Schema\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Generators\Schema\Author;
|
||||
|
||||
/**
|
||||
* Returns schema Author data for the CoAuthor Plus assigned user on a post.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class CoAuthor extends Author {
|
||||
|
||||
/**
|
||||
* The user ID of the author we're generating data for.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $user_id;
|
||||
|
||||
/**
|
||||
* Determine whether we should return Person schema.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_needed() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Person Schema data.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return bool|array Person data on success, false on failure.
|
||||
*/
|
||||
public function generate() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
$user_id = $this->determine_user_id();
|
||||
if ( ! $user_id ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = $this->build_person_data( $user_id, true );
|
||||
|
||||
$data['@type'] = 'Person';
|
||||
unset( $data['logo'] );
|
||||
|
||||
// If this is a post and the author archives are enabled, set the author archive url as the author url.
|
||||
if ( $this->helpers->options->get( 'disable-author' ) !== true ) {
|
||||
$data['url'] = $this->helpers->user->get_the_author_posts_url( $user_id );
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the Person data given a user ID.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param int $user_id User ID.
|
||||
*
|
||||
* @return array|bool
|
||||
*/
|
||||
public function generate_from_user_id( $user_id ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
$this->user_id = $user_id;
|
||||
|
||||
return $this->generate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines a User ID for the Person data.
|
||||
*
|
||||
* @return bool|int User ID or false upon return.
|
||||
*/
|
||||
protected function determine_user_id() {
|
||||
return $this->user_id;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Generators\Schema\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Context\Meta_Tags_Context;
|
||||
use Yoast\WP\SEO\Generators\Schema\Abstract_Schema_Piece;
|
||||
use Yoast\WP\SEO\Surfaces\Helpers_Surface;
|
||||
|
||||
/**
|
||||
* A class to handle textdomains and other Yoast Event Schema related logic..
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Events_Calendar_Schema extends Abstract_Schema_Piece {
|
||||
|
||||
/**
|
||||
* The meta tags context.
|
||||
*
|
||||
* @var Meta_Tags_Context
|
||||
*/
|
||||
public $context;
|
||||
|
||||
/**
|
||||
* The helpers surface
|
||||
*
|
||||
* @var Helpers_Surface
|
||||
*/
|
||||
public $helpers;
|
||||
|
||||
/**
|
||||
* Determines whether or not a piece should be added to the graph.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_needed() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds our Event piece of the graph.
|
||||
* Partially lifted from the 'Tribe__JSON_LD__Abstract' class.
|
||||
*
|
||||
* @see https://docs.theeventscalendar.com/reference/classes/tribe__json_ld__abstract/
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array Event Schema markup
|
||||
*/
|
||||
public function generate() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Integrations\Third_Party;
|
||||
|
||||
use WP_User;
|
||||
use Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Activated_Conditional;
|
||||
use Yoast\WP\SEO\Conditionals\Third_Party\CoAuthors_Plus_Flag_Conditional;
|
||||
use Yoast\WP\SEO\Config\Schema_Types;
|
||||
use Yoast\WP\SEO\Context\Meta_Tags_Context;
|
||||
use Yoast\WP\SEO\Generators\Schema\Abstract_Schema_Piece;
|
||||
use Yoast\WP\SEO\Generators\Schema\Third_Party\CoAuthor;
|
||||
use Yoast\WP\SEO\Integrations\Integration_Interface;
|
||||
use Yoast\WP\SEO\Surfaces\Helpers_Surface;
|
||||
|
||||
/**
|
||||
* Integrates the multiple authors capability from CoAuthors Plus into Yoast SEO schema.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class CoAuthors_Plus implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* The helpers surface.
|
||||
*
|
||||
* @var Helpers_Surface
|
||||
*/
|
||||
protected $helpers;
|
||||
|
||||
/**
|
||||
* Initializes the integration.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register_hooks() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
\add_filter( 'wpseo_schema_graph', [ $this, 'filter_graph' ], 11, 2 );
|
||||
\add_filter( 'wpseo_schema_author', [ $this, 'filter_author_graph' ], 11, 4 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the conditionals based in which this loadable should be active.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get_conditionals() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return [
|
||||
CoAuthors_Plus_Activated_Conditional::class,
|
||||
CoAuthors_Plus_Flag_Conditional::class,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* CoAuthors_Plus constructor.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param Helpers_Surface $helpers The helper surface.
|
||||
*/
|
||||
public function __construct( Helpers_Surface $helpers ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
$this->helpers = $helpers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the graph output to add authors.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param array $data The schema graph.
|
||||
* @param Meta_Tags_Context $context The context object.
|
||||
* @param Abstract_Schema_Piece $graph_piece_generator The graph piece generator.
|
||||
* @param Abstract_Schema_Piece[] $graph_piece_generators The graph piece generators.
|
||||
*
|
||||
* @return array The (potentially altered) schema graph.
|
||||
*/
|
||||
public function filter_author_graph( $data, $context, $graph_piece_generator, $graph_piece_generators ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
if ( ! isset( $data['image']['url'] ) ) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
if ( isset( $data['image']['@id'] ) ) {
|
||||
$data['image']['@id'] .= \md5( $data['image']['url'] );
|
||||
}
|
||||
|
||||
if ( isset( $data['logo']['@id'] ) ) {
|
||||
$data['logo']['@id'] .= \md5( $data['image']['url'] );
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the graph output to add authors.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param array $data The schema graph.
|
||||
* @param Meta_Tags_Context $context Context object.
|
||||
*
|
||||
* @return array The (potentially altered) schema graph.
|
||||
*/
|
||||
public function filter_graph( $data, $context ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
if ( ! \is_singular() ) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
if ( ! \function_exists( '\get_coauthors' ) ) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains the authors from the CoAuthors Plus plugin.
|
||||
*
|
||||
* @var WP_User[] $author_objects
|
||||
*/
|
||||
$author_objects = \get_coauthors( $context->post->ID );
|
||||
if ( \count( $author_objects ) <= 1 ) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
$ids = [];
|
||||
|
||||
// Add the authors to the schema.
|
||||
foreach ( $author_objects as $author ) {
|
||||
if ( $author->ID === (int) $context->post->post_author ) {
|
||||
continue;
|
||||
}
|
||||
$author_generator = new CoAuthor();
|
||||
$author_generator->context = $context;
|
||||
$author_generator->helpers = $this->helpers;
|
||||
$author_data = $author_generator->generate_from_user_id( $author->ID );
|
||||
if ( ! empty( $author_data ) ) {
|
||||
$ids[] = [ '@id' => $author_data['@id'] ];
|
||||
}
|
||||
}
|
||||
|
||||
$schema_types = new Schema_Types();
|
||||
$article_types = $schema_types->get_article_type_options_values();
|
||||
|
||||
// Change the author reference to reference our multiple authors.
|
||||
$add_to_graph = false;
|
||||
foreach ( $data as $key => $piece ) {
|
||||
if ( \in_array( $piece['@type'], $article_types, true ) ) {
|
||||
$data[ $key ]['author'] = \array_merge( [ $piece['author'] ], $ids );
|
||||
$add_to_graph = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $add_to_graph ) {
|
||||
if ( ! empty( $author_data ) ) {
|
||||
if ( $context->site_represents !== 'person' || $author->ID !== $context->site_user_id ) {
|
||||
$data[] = $author_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Integrations\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Front_End_Conditional;
|
||||
use Yoast\WP\SEO\Conditionals\Open_Graph_Conditional;
|
||||
use Yoast\WP\SEO\Integrations\Integration_Interface;
|
||||
|
||||
/**
|
||||
* Class The_Events_Calendar
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class The_Events_Calendar implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Returns the conditionals based in which this loadable should be active.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get_conditionals() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
return [ Front_End_Conditional::class, Open_Graph_Conditional::class ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the integration.
|
||||
*
|
||||
* This is the place to register hooks and filters.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register_hooks() {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the events graph pieces to the schema collector.
|
||||
*
|
||||
* @deprecated 19.12
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param array $pieces The current graph pieces.
|
||||
* @param string $context The current context.
|
||||
*
|
||||
* @return array Extended graph pieces.
|
||||
*/
|
||||
public function add_graph_pieces( $pieces, $context ) {
|
||||
\_deprecated_function( __METHOD__, 'Yoast SEO 19.12' );
|
||||
|
||||
return $pieces;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user