Your IP : 216.73.216.162


Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/
Upload File :
Current File : /home/x/b/o/xbodynamge/namtation/wp-content/frontend.tar

google-map/loader.js000066600000004105151117722440010407 0ustar00const initMapScript = () => {
	let maps = [];
	maps = window.themeisleGoogleMaps;

	maps.forEach( map => {
		const googleMap = new google.maps.Map( document.getElementById( map.container ), {
			center: {
				lat: Number( map.attributes.latitude ),
				lng: Number( map.attributes.longitude )
			},
			gestureHandling: 'cooperative',
			zoom: map.attributes.zoom,
			mapTypeId: map.attributes.type,
			draggable: map.attributes.draggable,
			mapTypeControl: map.attributes.mapTypeControl,
			zoomControl: map.attributes.zoomControl,
			fullscreenControl: map.attributes.fullscreenControl,
			streetViewControl: map.attributes.streetViewControl
		});

		if ( ! map.attributes.id && map.attributes.location ) {
			const request = {
				query: map.attributes.location,
				fields: [ 'name', 'geometry' ]
			};

			const service = new google.maps.places.PlacesService( googleMap );

			service.findPlaceFromQuery( request, ( results, status ) => {
				if ( status === google.maps.places.PlacesServiceStatus.OK ) {
					if ( 0 < results.length ) {
						googleMap.setCenter( results[0].geometry.location );
					}
				}
			});
		}

		if (  map.attributes.markers && 0 < map.attributes.markers.length ) {
			map.attributes.markers.forEach( marker => {
				const position = new google.maps.LatLng( marker.latitude, marker.longitude );

				const mark = new google.maps.Marker({
					position,
					map: googleMap,
					title: marker.title,
					icon: marker.icon || 'https://maps.google.com/mapfiles/ms/icons/red-dot.png'
				});

				if ( marker.title || marker.description ) {
					const contentString = `<div class="wp-block-themeisle-blocks-map-overview"><h6 class="wp-block-themeisle-blocks-map-overview-title">${ marker.title }</h6><div class="wp-block-themeisle-blocks-map-overview-content">${ marker.description ? `<p>${ marker.description }</p>` : '' }</div></div>`;

					const infowindow = new google.maps.InfoWindow({
						content: contentString
					});

					mark.addListener( 'click', () => {
						infowindow.open( googleMap, mark );
					});
				}
			});
		}
	});
};

window.initMapScript = initMapScript;
class-woocommerce-shop-page.php000066600000002576151140126750012600 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Deprecated\Frontend
 */

use Yoast\WP\SEO\Helpers\Woocommerce_Helper;

/**
 * Represents the logic to determine if the current page is a WooCommerce shop page.
 *
 * @deprecated 14.9
 * @codeCoverageIgnore
 */
class WPSEO_WooCommerce_Shop_Page {

	/**
	 * Checks if the current page is the shop page.
	 *
	 * @deprecated 14.9
	 * @codeCoverageIgnore
	 *
	 * @return bool Whether the current page is the WooCommerce shop page.
	 */
	public function is_shop_page() {
		_deprecated_function( __METHOD__, 'WPSEO 14.9', Woocommerce_Helper::class . '::is_shop_page' );

		return YoastSEO()->helpers->woocommerce->is_shop_page();
	}

	/**
	 * Returns the id of the set WooCommerce shop page.
	 *
	 * @deprecated 14.9
	 * @codeCoverageIgnore
	 *
	 * @return int The ID of the set page.
	 */
	public function get_shop_page_id() {
		_deprecated_function( __METHOD__, 'WPSEO 14.9', Woocommerce_Helper::class . '::get_shop_page_id' );

		return YoastSEO()->helpers->woocommerce->get_shop_page_id();
	}

	/**
	 * Returns the ID of the WooCommerce shop page when the currently opened page is the shop page.
	 *
	 * @codeCoverageIgnore
	 * @deprecated 14.0
	 *
	 * @param int $page_id The page id.
	 *
	 * @return int The Page ID of the shop.
	 */
	public function get_page_id( $page_id ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return $page_id;
	}
}
breadcrumbs.php000066600000006310151140126750007554 0ustar00<?php
/**
 * Backwards compatibility class for breadcrumbs.
 *
 * @package Yoast\YoastSEO\Backwards_Compatibility
 */

use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
use Yoast\WP\SEO\Presenters\Breadcrumbs_Presenter;
use Yoast\WP\SEO\Surfaces\Helpers_Surface;

/**
 * Class WPSEO_Breadcrumbs
 *
 * @codeCoverageIgnore Because of deprecation.
 */
class WPSEO_Breadcrumbs {

	/**
	 * Instance of this class.
	 *
	 * @var WPSEO_Breadcrumbs
	 */
	public static $instance;

	/**
	 * Last used 'before' string.
	 *
	 * @var string
	 */
	public static $before = '';

	/**
	 * Last used 'after' string.
	 *
	 * @var string
	 */
	public static $after = '';

	/**
	 * The memoizer for the meta tags context.
	 *
	 * @var Meta_Tags_Context_Memoizer
	 */
	protected $context_memoizer;

	/**
	 * The helpers surface.
	 *
	 * @var Helpers_Surface
	 */
	protected $helpers;

	/**
	 * The replace vars helper
	 *
	 * @var WPSEO_Replace_Vars
	 */
	protected $replace_vars;

	/**
	 * WPSEO_Breadcrumbs constructor.
	 */
	public function __construct() {
		$this->context_memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
		$this->helpers          = YoastSEO()->classes->get( Helpers_Surface::class );
		$this->replace_vars     = YoastSEO()->classes->get( WPSEO_Replace_Vars::class );
	}

	/**
	 * Get breadcrumb string using the singleton instance of this class.
	 *
	 * @param string $before  Optional string to prepend.
	 * @param string $after   Optional string to append.
	 * @param bool   $display Echo or return flag.
	 *
	 * @return string Returns the breadcrumbs as a string.
	 */
	public static function breadcrumb( $before = '', $after = '', $display = true ) {
		// Remember the last used before/after for use in case the object goes __toString().
		self::$before = $before;
		self::$after  = $after;
		$output       = $before . self::get_instance()->render() . $after;

		if ( $display === true ) {
			echo $output;

			return '';
		}

		return $output;
	}

	/**
	 * Magic method to use in case the class would be send to string.
	 *
	 * @return string The rendered breadcrumbs.
	 */
	public function __toString() {
		return self::$before . $this->render() . self::$after;
	}

	/**
	 * Retrieves an instance of the class.
	 *
	 * @return static The instance.
	 */
	public static function get_instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	/**
	 * Returns the collected links for the breadcrumbs.
	 *
	 * @return array The collected links.
	 */
	public function get_links() {
		$context = $this->context_memoizer->for_current_page();

		return $context->presentation->breadcrumbs;
	}

	/**
	 * Renders the breadcrumbs.
	 *
	 * @return string The rendered breadcrumbs.
	 */
	private function render() {
		$presenter = new Breadcrumbs_Presenter();
		$context   = $this->context_memoizer->for_current_page();
		/** This filter is documented in src/integrations/front-end-integration.php */
		$presentation            = apply_filters( 'wpseo_frontend_presentation', $context->presentation, $context );
		$presenter->presentation = $presentation;
		$presenter->replace_vars = $this->replace_vars;
		$presenter->helpers      = $this->helpers;

		return $presenter->present();
	}
}
class-twitter.php000066600000002033151140126750010066 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend
 */

/**
 * This class handles the Twitter card functionality.
 *
 * @deprecated 14.0
 *
 * @link https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards
 */
class WPSEO_Twitter {

	/**
	 * Instance of this class.
	 *
	 * @var WPSEO_Twitter
	 */
	public static $instance;

	/**
	 * Images.
	 *
	 * @var array
	 */
	public $shown_images = [];

	/**
	 * Class constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 */
	public function __construct() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}

	/**
	 * Outputs the Twitter Card code on singular pages.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 */
	public function twitter() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}

	/**
	 * Get the singleton instance of this class.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return object|null
	 */
	public static function get_instance() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return null;
	}
}
class-opengraph-oembed.php000066600000002146151140126750011605 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend
 */

/**
 * Class WPSEO_OpenGraph_OEmbed.
 *
 * @deprecated 14.0
 */
class WPSEO_OpenGraph_OEmbed implements WPSEO_WordPress_Integration {

	/**
	 * {@inheritDoc}
	 *
	 * @codeCoverageIgnore
	 * @deprecated 14.0
	 */
	public function register_hooks() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}

	/**
	 * Callback function to pass to the oEmbed's response data that will enable
	 * support for using the image and title set by the WordPress SEO plugin's fields. This
	 * address the concern where some social channels/subscribed use oEmebed data over OpenGraph data
	 * if both are present.
	 *
	 * @link https://developer.wordpress.org/reference/hooks/oembed_response_data/ for hook info.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array   $data The oEmbed data.
	 * @param WP_Post $post The current Post object.
	 *
	 * @return array An array of oEmbed data with modified values where appropriate.
	 */
	public function set_oembed_data( $data, $post ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return $data;
	}
}
class-frontend-page-type.php000066600000003436151140126750012104 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Deprecated\Frontend
 */

/**
 * Represents the classifier for determine the type of the currently opened page.
 *
 * @deprecated 14.9
 * @codeCoverageIgnore
 */
class WPSEO_Frontend_Page_Type {

	/**
	 * Checks if the currently opened page is a simple page.
	 *
	 * @deprecated 14.9
	 * @codeCoverageIgnore
	 *
	 * @return bool Whether the currently opened page is a simple page.
	 */
	public static function is_simple_page() {
		_deprecated_function( __METHOD__, 'WPSEO 14.9' );

		return false;
	}

	/**
	 * Returns the id of the currently opened page.
	 *
	 * @deprecated 14.9
	 * @codeCoverageIgnore
	 *
	 * @return int The id of the currently opened page.
	 */
	public static function get_simple_page_id() {
		_deprecated_function( __METHOD__, 'WPSEO 14.9' );

		return 0;
	}

	/**
	 * Determine whether this is the homepage and shows posts.
	 *
	 * @deprecated 14.9
	 * @codeCoverageIgnore
	 *
	 * @return bool Whether or not the current page is the homepage that displays posts.
	 */
	public static function is_home_posts_page() {
		_deprecated_function( __METHOD__, 'WPSEO 14.9' );

		return false;
	}

	/**
	 * Determine whether this is the static frontpage.
	 *
	 * @deprecated 14.9
	 * @codeCoverageIgnore
	 *
	 * @return bool Whether or not the current page is a static frontpage.
	 */
	public static function is_home_static_page() {
		_deprecated_function( __METHOD__, 'WPSEO 14.9' );

		return false;
	}

	/**
	 * Determine whether this is the statically set posts page, when it's not the frontpage.
	 *
	 * @deprecated 14.9
	 * @codeCoverageIgnore
	 *
	 * @return bool Whether or not it's a non-frontpage, statically set posts page.
	 */
	public static function is_posts_page() {
		_deprecated_function( __METHOD__, 'WPSEO 14.9' );

		return false;
	}
}
.htaccess000066600000000424151140126750006350 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>schema/class-schema-main-image.php000066600000004031151140126750013066 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Generators\Schema\Main_Image;

/**
 * Returns ImageObject schema data.
 *
 * @since      11.5
 * @deprecated 14.0
 * @codeCoverageIgnore
 */
class WPSEO_Schema_MainImage extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * WPSEO_Schema_WebPage constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( Main_Image::class );
	}

	/**
	 * Gets the post's first usable content image. Null if none is available.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param int $post_id The post id.
	 *
	 * @return string|null The image URL or null if there is no image.
	 */
	protected function get_first_usable_content_image_for_post( $post_id ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return WPSEO_Image_Utils::get_first_usable_content_image_for_post( $post_id );
	}

	/**
	 * Generates image schema from the attachment id.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param string $image_id The image schema id.
	 *
	 * @return array Schema ImageObject array.
	 */
	protected function generate_image_schema_from_attachment_id( $image_id ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->image->generate_from_attachment_id' );

		return $this->helpers->schema->image->generate_from_attachment_id( $image_id, get_post_thumbnail_id() );
	}

	/**
	 * Generates image schema from the url.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param string $image_id  The image schema id.
	 * @param string $image_url The image URL.
	 *
	 * @return array Schema ImageObject array.
	 */
	protected function generate_image_schema_from_url( $image_id, $image_url ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->image->generate_from_url' );

		return $this->helpers->schema->image->generate_from_url( $image_id, $image_url );
	}
}
schema/.htaccess000066600000000424151140126750007610 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>schema/class-schema-website.php000066600000001033151140126750012523 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Generators\Schema\Website;

/**
 * Returns schema Website data.
 *
 * @since      10.2
 * @deprecated 14.0
 */
class WPSEO_Schema_Website extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * WPSEO_Schema_Website constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( Website::class );
	}
}
schema/class-schema-breadcrumb.php000066600000001052151140126750013170 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Generators\Schema\Breadcrumb;

/**
 * Returns schema Breadcrumb data.
 *
 * @since      10.2
 * @deprecated 14.0
 */
class WPSEO_Schema_Breadcrumb extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * WPSEO_Schema_Breadcrumb constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( Breadcrumb::class );
	}
}
schema/class-schema-person.php000066600000010125151140126750012371 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Config\Schema_IDs;
use Yoast\WP\SEO\Generators\Schema\Person;

/**
 * Returns schema Person data.
 *
 * @since      10.2
 * @deprecated 14.0
 */
class WPSEO_Schema_Person extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * The hash used for images.
	 *
	 * @var string
	 */
	protected $image_hash = Schema_IDs::PERSON_LOGO_HASH;

	/**
	 * Array of the social profiles we display for a Person.
	 *
	 * @var string[]
	 */
	private $social_profiles = [
		'facebook',
		'instagram',
		'linkedin',
		'pinterest',
		'twitter',
		'myspace',
		'youtube',
		'soundcloud',
		'tumblr',
		'wikipedia',
	];

	/**
	 * WPSEO_Schema_Person constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( Person::class );
	}

	/**
	 * Determines a User ID for the Person data.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return bool|int User ID or false upon return.
	 */
	protected function determine_user_id() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::determine_user_id' );

		return $this->stable->determine_user_id();
	}

	/**
	 * Retrieve a list of social profile URLs for Person.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param int $user_id User ID.
	 *
	 * @return string[] A list of social profiles.
	 */
	protected function get_social_profiles( $user_id ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::get_social_profiles' );

		/**
		 * Filter: 'wpseo_schema_person_social_profiles' - Allows filtering of social profiles per user.
		 *
		 * @param int $user_id The current user we're grabbing social profiles for.
		 *
		 * @api string[] $social_profiles The array of social profiles to retrieve. Each should be a user meta field
		 *                                key. As they are retrieved using the WordPress function `get_the_author_meta`.
		 */
		$social_profiles = apply_filters( 'wpseo_schema_person_social_profiles', $this->social_profiles, $user_id );
		$output          = [];

		// We can only handle an array.
		if ( ! is_array( $social_profiles ) ) {
			return $output;
		}

		foreach ( $social_profiles as $profile ) {
			// Skip non-string values.
			if ( ! is_string( $profile ) ) {
				continue;
			}

			$social_url = $this->url_social_site( $profile, $user_id );
			if ( $social_url ) {
				$output[] = $social_url;
			}
		}

		return $output;
	}

	/**
	 * Builds our array of Schema Person data for a given user ID.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param int $user_id The user ID to use.
	 *
	 * @return array An array of Schema Person data.
	 */
	protected function build_person_data( $user_id ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::build_person_data' );

		return $this->stable->build_person_data( $user_id );
	}

	/**
	 * Returns an ImageObject for the persons avatar.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array   $data      The Person schema.
	 * @param WP_User $user_data User data.
	 *
	 * @return array The Person schema.
	 */
	protected function add_image( $data, $user_data ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::add_image' );

		return $this->stable->add_image( $data, $user_data );
	}

	/**
	 * Returns an author's social site URL.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param string $social_site The social site to retrieve the URL for.
	 * @param mixed  $user_id     The user ID to use function outside of the loop.
	 *
	 * @return string
	 */
	protected function url_social_site( $social_site, $user_id = false ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Person::url_social_site' );

		$url = get_the_author_meta( $social_site, $user_id );

		if ( ! empty( $url ) && $social_site === 'twitter' ) {
			$url = 'https://twitter.com/' . $url;
		}

		return $url;
	}
}
schema/class-schema-ids.php000066600000002254151140126750011646 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

/**
 * Constants used for @id variables.
 *
 * @since      10.2
 * @deprecated 14.0
 */
class WPSEO_Schema_IDs {

	/**
	 * Hash used for the Author `@id`.
	 */
	const AUTHOR_HASH = '#author';

	/**
	 * Hash used for the Author Logo's `@id`.
	 */
	const AUTHOR_LOGO_HASH = '#authorlogo';

	/**
	 * Hash used for the Breadcrumb's `@id`.
	 */
	const BREADCRUMB_HASH = '#breadcrumb';

	/**
	 * Hash used for the Person `@id`.
	 */
	const PERSON_HASH = '#/schema/person/';

	/**
	 * Hash used for the Article `@id`.
	 */
	const ARTICLE_HASH = '#article';

	/**
	 * Hash used for the Organization `@id`.
	 */
	const ORGANIZATION_HASH = '#organization';

	/**
	 * Hash used for the Organization `@id`.
	 */
	const ORGANIZATION_LOGO_HASH = '#logo';

	/**
	 * Hash used for the logo `@id`.
	 */
	const PERSON_LOGO_HASH = '#personlogo';

	/**
	 * Hash used for an Article's primary image `@id`.
	 */
	const PRIMARY_IMAGE_HASH = '#primaryimage';

	/**
	 * Hash used for the WebPage's `@id`.
	 *
	 * @deprecated 19.3
	 */
	const WEBPAGE_HASH = '';

	/**
	 * Hash used for the Website's `@id`.
	 */
	const WEBSITE_HASH = '#website';
}
schema/class-schema-author.php000066600000005116151140126750012371 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Config\Schema_IDs;
use Yoast\WP\SEO\Generators\Schema\Author;

/**
 * Returns schema Person data.
 *
 * @since      10.2
 * @deprecated 14.0
 */
class WPSEO_Schema_Author extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * The hash used for images.
	 *
	 * @var string
	 */
	protected $image_hash = Schema_IDs::AUTHOR_LOGO_HASH;

	/**
	 * The Schema type we use for this class.
	 *
	 * @var string[]
	 */
	protected $type = [ 'Person' ];

	/**
	 * WPSEO_Schema_Author constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( Author::class );
	}

	/**
	 * Determine whether we should return Person schema.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return bool
	 */
	public function is_needed() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Author::is_needed' );

		if ( $this->stable->context->indexable->object_type === 'user' ) {
			return true;
		}

		// This call to `is_post_author` is why this whole block could not be replaced with a `parent::is_needed()` call.
		if ( $this->is_post_author() ) {
			// If the author is the user the site represents, no need for an extra author block.
			if ( $this->stable->is_needed() ) {
				return (int) $this->stable->context->post->post_author !== $this->stable->context->site_user_id;
			}

			return true;
		}

		return false;
	}

	/**
	 * Gets the Schema type we use for this class.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return string[] The schema type.
	 */
	public static function get_type() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return [ 'Person' ];
	}

	/**
	 * Determine whether the current URL is worthy of Article schema.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return bool
	 */
	protected function is_post_author() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return (
			$this->stable->context->indexable->object_type === 'post'
			&& $this->helpers->schema->article->is_article_post_type( $this->stable->context->indexable->object_sub_type )
		);
	}

	/**
	 * Determines a User ID for the Person data.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return bool|int User ID or false upon return.
	 */
	protected function determine_user_id() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\Author::determine_user_id' );

		return parent::determine_user_id();
	}
}
schema/class-schema-faq-question-list.php000066600000001613151140126750014452 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

/**
 * Returns a question object for each question in an FAQ block.
 *
 * @since 11.1
 *
 * @deprecated 14.0
 */
class WPSEO_Schema_FAQ_Question_List {

	/**
	 * WPSEO_Schema_FAQ_Question_List constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param WP_Block_Parser_Block[] $blocks  An array of the FAQ blocks on this page.
	 * @param WPSEO_Schema_Context    $context A value object with context variables.
	 */
	public function __construct( $blocks, $context ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}

	/**
	 * Find an image based on its URL and generate a Schema object for it.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return array The Schema with a question list added.
	 */
	public function generate() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return [];
	}
}
schema/class-schema.php000066600000001646151140126750011075 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

/**
 * Class WPSEO_Schema
 *
 * Outputs schema code specific for Google's JSON LD stuff.
 *
 * @since      1.8
 * @deprecated 14.0
 */
class WPSEO_Schema implements WPSEO_WordPress_Integration {

	/**
	 * Registers the hooks.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 */
	public function register_hooks() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}

	/**
	 * JSON LD output function that the functions for specific code can hook into.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @since 1.8
	 */
	public function json_ld() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}

	/**
	 * Outputs the JSON LD code in a valid JSON+LD wrapper.
	 *
	 * @since      10.2
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return void
	 */
	public function generate() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}
}
schema/interface-wpseo-graph-piece.php000066600000001055151140126750014001 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

if ( ! interface_exists( 'WPSEO_Graph_Piece' ) ) {
	/**
	 * An interface for registering Schema Graph Pieces.
	 *
	 * @since      10.2
	 * @deprecated 14.0
	 */
	interface WPSEO_Graph_Piece {

		/**
		 * Add your piece of the graph.
		 *
		 * @return array|bool A graph piece on success, false on failure.
		 */
		public function generate();

		/**
		 * Determines whether or not a piece should be added to the graph.
		 *
		 * @return bool
		 */
		public function is_needed();
	}
}
schema/class-schema-article.php000066600000002246151140126750012513 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Generators\Schema\Article;

/**
 * Returns schema Article data.
 *
 * @since      10.2
 * @deprecated 14.0
 */
class WPSEO_Schema_Article extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * The date helper.
	 *
	 * @var WPSEO_Date_Helper
	 */
	protected $date;

	/**
	 * WPSEO_Schema_Article constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array|null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( Article::class );

		$this->date = new WPSEO_Date_Helper();
	}

	/**
	 * Determines whether a given post type should have Article schema.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param string|null $post_type Post type to check.
	 *
	 * @return bool True if it has article schema, false if not.
	 */
	public static function is_article_post_type( $post_type = null ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->article->is_article_post_type' );

		return YoastSEO()->helpers->schema->article->is_article_post_type( $post_type );
	}
}
schema/class-schema-webpage.php000066600000002755151140126750012507 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Generators\Schema\WebPage;

/**
 * Returns schema WebPage data.
 *
 * @since      10.2
 * @deprecated 14.0
 */
class WPSEO_Schema_WebPage extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * The date helper.
	 *
	 * @var WPSEO_Date_Helper
	 */
	protected $date;

	/**
	 * WPSEO_Schema_WebPage constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( WebPage::class );

		$this->date = new WPSEO_Date_Helper();
	}

	/**
	 * Adds an author property to the $data if the WebPage is not represented.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array   $data The WebPage schema.
	 * @param WP_Post $post The post the context is representing.
	 *
	 * @return array The WebPage schema.
	 */
	public function add_author( $data, $post ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::add_author' );

		return $this->stable->add_author( $data, $post );
	}

	/**
	 * If we have an image, make it the primary image of the page.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array $data WebPage schema data.
	 */
	public function add_image( &$data ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::add_image' );

		$this->stable->add_image( $data );
	}
}
schema/class-schema-organization.php000066600000001064151140126750013571 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Generators\Schema\Organization;

/**
 * Returns schema Organization data.
 *
 * @since      10.2
 * @deprecated 14.0
 */
class WPSEO_Schema_Organization extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * WPSEO_Schema_Organization constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( Organization::class );
	}
}
schema/class-schema-image.php000066600000005106151140126750012150 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

/**
 * Returns schema image data.
 *
 * @since 11.1
 *
 * @deprecated 14.0
 *
 * @property string $schema_id      The `@id` to use for the returned image.
 * @property array  $data           The ImageObject Schema array.
 * @property int    $attachment_id  The ID of the attachment used to generate the object.
 */
class WPSEO_Schema_Image {

	/**
	 * Value to use as the image id.
	 *
	 * @var string
	 */
	private $schema_id;

	/**
	 * WPSEO_Schema_Image constructor.
	 *
	 * @codeCoverageIgnore
	 * @deprecated 14.0
	 *
	 * @param string $schema_id The string to use in an image's `@id`.
	 */
	public function __construct( $schema_id ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->image' );
		$this->schema_id = $schema_id;
	}

	/**
	 * Find an image based on its URL and generate a Schema object for it.
	 *
	 * @codeCoverageIgnore
	 * @deprecated 14.0
	 *
	 * @param string $url     The image URL to base our object on.
	 * @param string $caption An optional caption.
	 *
	 * @return array Schema ImageObject array.
	 */
	public function generate_from_url( $url, $caption = '' ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->image->generate_from_url' );
		return YoastSEO()->helpers->schema->image->generate_from_url( $this->schema_id, $url, $caption );
	}

	/**
	 * Retrieve data about an image from the database and use it to generate a Schema object.
	 *
	 * @codeCoverageIgnore
	 * @deprecated 14.0
	 *
	 * @param int    $attachment_id The attachment to retrieve data from.
	 * @param string $caption       The caption string, if there is one.
	 *
	 * @return array Schema ImageObject array.
	 */
	public function generate_from_attachment_id( $attachment_id, $caption = '' ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->image->generate_from_attachment_id' );
		return YoastSEO()->helpers->schema->image->generate_from_attachment_id( $this->schema_id, $attachment_id, $caption );
	}

	/**
	 * If we can't find $url in our database, we output a simple ImageObject.
	 *
	 * @codeCoverageIgnore
	 * @deprecated 14.0
	 *
	 * @param string $url     The image URL.
	 * @param string $caption A caption, if set.
	 *
	 * @return array Schema ImageObject array.
	 */
	public function simple_image_object( $url, $caption = '' ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->image->simple_image_object' );
		return YoastSEO()->helpers->schema->image->simple_image_object( $this->schema_id, $url, $caption );
	}
}
schema/class-schema-howto.php000066600000013754151140126750012236 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Config\Schema_IDs;
use Yoast\WP\SEO\Generators\Schema\HowTo;

/**
 * Returns schema FAQ data.
 *
 * @since      11.5
 * @deprecated 14.0
 */
class WPSEO_Schema_HowTo extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * The HowTo blocks count on the current page.
	 *
	 * @var int
	 */
	private $counter = 0;

	/**
	 * WPSEO_Schema_FAQ constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( HowTo::class );
	}

	/**
	 * Renders the How-To block into our graph.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array $graph Our Schema data.
	 * @param array $block The How-To block content.
	 *
	 * @return mixed
	 */
	public function render( $graph, $block ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\HowTo::add_how_to' );

		++$this->counter;
		$this->add_how_to( $graph, $block, $this->counter );

		return $graph;
	}

	/**
	 * Generates the HowTo schema for a block.
	 *
	 * @param array $graph Our Schema data.
	 * @param array $block The How-To block content.
	 * @param int   $index The index of the current block.
	 */
	protected function add_how_to( &$graph, $block, $index ) {
		$data = [
			'@type'            => 'HowTo',
			'@id'              => $this->stable->context->canonical . '#howto-' . ( $index + 1 ),
			'name'             => $this->helpers->schema->html->smart_strip_tags( $this->helpers->post->get_post_title_with_fallback( $this->stable->context->id ) ),
			'mainEntityOfPage' => [ '@id' => $this->stable->context->main_schema_id ],
			'description'      => '',
		];

		if ( $this->stable->context->has_article ) {
			$data['mainEntityOfPage'] = [ '@id' => $this->stable->context->main_schema_id . Schema_IDs::ARTICLE_HASH ];
		}

		if ( isset( $block['attrs']['jsonDescription'] ) ) {
			$data['description'] = $this->helpers->schema->html->sanitize( $block['attrs']['jsonDescription'] );
		}

		$this->add_duration( $data, $block['attrs'] );
		$this->add_steps( $data, $block['attrs']['steps'] );

		$data = $this->helpers->schema->language->add_piece_language( $data );

		$graph[] = $data;
	}

	/**
	 * Adds the steps to our How-To output.
	 *
	 * @param array $data  Our How-To schema data.
	 * @param array $steps Our How-To block's steps.
	 */
	private function add_steps( &$data, $steps ) {
		foreach ( $steps as $step ) {
			$schema_id   = $this->stable->context->canonical . '#' . esc_attr( $step['id'] );
			$schema_step = [
				'@type' => 'HowToStep',
				'url'   => $schema_id,
			];

			if ( isset( $step['jsonText'] ) ) {
				$json_text = $this->helpers->schema->html->sanitize( $step['jsonText'] );
			}

			if ( isset( $step['jsonName'] ) ) {
				$json_name = $this->helpers->schema->html->smart_strip_tags( $step['jsonName'] );
			}

			if ( empty( $json_name ) ) {
				if ( empty( $step['text'] ) ) {
					continue;
				}

				$schema_step['text'] = '';

				$this->add_step_image( $schema_step, $step );

				// If there is no text and no image, don't output the step.
				if ( empty( $json_text ) && empty( $schema_step['image'] ) ) {
					continue;
				}

				if ( ! empty( $json_text ) ) {
					$schema_step['text'] = $json_text;
				}
			}

			elseif ( empty( $json_text ) ) {
				$schema_step['text'] = $json_name;
			}
			else {
				$schema_step['name'] = $json_name;

				$schema_step['itemListElement'] = [
					[
						'@type' => 'HowToDirection',
						'text'  => $json_text,
					],
				];

				$this->add_step_description( $schema_step, $json_text );
				$this->add_step_image( $schema_step, $step );
			}

			$data['step'][] = $schema_step;
		}
	}

	/**
	 * Adds the duration of the task to the Schema.
	 *
	 * @param array $data       Our How-To schema data.
	 * @param array $attributes The block data attributes.
	 */
	private function add_duration( &$data, $attributes ) {
		if ( empty( $attributes['hasDuration'] ) ) {
			return;
		}

		$days    = empty( $attributes['days'] ) ? 0 : $attributes['days'];
		$hours   = empty( $attributes['hours'] ) ? 0 : $attributes['hours'];
		$minutes = empty( $attributes['minutes'] ) ? 0 : $attributes['minutes'];

		if ( ( $days + $hours + $minutes ) > 0 ) {
			$data['totalTime'] = esc_attr( 'P' . $days . 'DT' . $hours . 'H' . $minutes . 'M' );
		}
	}

	/**
	 * Determines whether we're part of an article or a webpage.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return string A reference URL.
	 */
	protected function get_main_schema_id() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return $this->stable->context->main_schema_id;
	}

	/**
	 * Checks if we have a step description, if we do, add it.
	 *
	 * @param array  $schema_step Our Schema output for the Step.
	 * @param string $json_text   The step text.
	 */
	private function add_step_description( &$schema_step, $json_text ) {
		$schema_step['itemListElement'] = [
			[
				'@type' => 'HowToDirection',
				'text'  => $json_text,
			],
		];
	}

	/**
	 * Checks if we have a step image, if we do, add it.
	 *
	 * @param array $schema_step Our Schema output for the Step.
	 * @param array $step        The step block data.
	 */
	private function add_step_image( &$schema_step, $step ) {
		foreach ( $step['text'] as $line ) {
			if ( is_array( $line ) && isset( $line['type'] ) && $line['type'] === 'img' ) {
				$schema_step['image'] = $this->get_image_schema( esc_url( $line['props']['src'] ) );
			}
		}
	}

	/**
	 * Generates the image schema from the attachment $url.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param string $url Attachment url.
	 *
	 * @return array Image schema.
	 */
	protected function get_image_schema( $url ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\HowTo::get_image_schema' );

		$schema_id = $this->stable->context->canonical . '#schema-image-' . md5( $url );

		return $this->helpers->schema->image->generate_from_url( $schema_id, $url );
	}
}
schema/class-schema-utils.php000066600000003607151140126750012232 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

/**
 * Schema utility functions.
 *
 * @since      11.6
 * @deprecated 14.0
 */
class WPSEO_Schema_Utils {

	/**
	 * Retrieves a user's Schema ID.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param int                  $user_id The ID of the User you need a Schema ID for.
	 * @param WPSEO_Schema_Context $context A value object with context variables.
	 *
	 * @return string The user's schema ID.
	 */
	public static function get_user_schema_id( $user_id, $context ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->id->get_user_schema_id' );
		return YoastSEO()->helpers->schema->id->get_user_schema_id( $user_id, $context );
	}

	/**
	 * Retrieves the post title with fallback to `No title`.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param int $post_id Optional. Post ID.
	 *
	 * @return string The post title with fallback to `No title`.
	 */
	public static function get_post_title_with_fallback( $post_id = 0 ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', ' YoastSEO()->helpers->post->get_post_title_with_fallback' );
		return YoastSEO()->helpers->post->get_post_title_with_fallback( $post_id );
	}

	/**
	 * Adds the `inLanguage` property to a Schema piece.
	 *
	 * Must use one of the language codes from the IETF BCP 47 standard. The
	 * language tag syntax is made of one or more subtags separated by a hyphen
	 * e.g. "en", "en-US", "zh-Hant-CN".
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array $data The Schema piece data.
	 *
	 * @return array The Schema piece data with added language property.
	 */
	public static function add_piece_language( $data ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->language->add_piece_language' );
		return YoastSEO()->helpers->schema->language->add_piece_language( $data );
	}
}
schema/class-schema-faq.php000066600000003476151140126750011645 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Generators\Schema\FAQ;

/**
 * Returns schema FAQ data.
 *
 * @since      11.3
 * @deprecated 14.0
 */
class WPSEO_Schema_FAQ extends WPSEO_Deprecated_Graph_Piece {

	/**
	 * WPSEO_Schema_FAQ constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param null $context The context. No longer used but present for BC.
	 */
	public function __construct( $context = null ) {
		parent::__construct( FAQ::class );
	}

	/**
	 * If this fires, we know there's an FAQ block ont he page, so filter the page type.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array $blocks The blocks of this type on the current page.
	 */
	public function prepare_schema( $blocks ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}

	/**
	 * Change the page type to an array if it isn't one, include FAQPage.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array|string $page_type The page type.
	 *
	 * @return array The page type that's now an array.
	 */
	public function change_schema_page_type( $page_type ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		if ( ! is_array( $page_type ) ) {
			$page_type = [ $page_type ];
		}
		$page_type[] = 'FAQPage';

		return $page_type;
	}

	/**
	 * Add the Questions in our FAQ blocks as separate pieces to the graph.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array                 $graph   Schema data for the current page.
	 * @param WP_Block_Parser_Block $block   The block data array.
	 * @param WPSEO_Schema_Context  $context A value object with context variables.
	 *
	 * @return array Our Schema graph.
	 */
	public function render_schema_questions( $graph, $block, $context ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return [];
	}
}
schema/class-schema-faq-questions.php000066600000002724151140126750013670 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

/**
 * Returns a question object for each question in an FAQ block.
 *
 * @since      11.1
 * @deprecated 14.0
 */
class WPSEO_Schema_FAQ_Questions {

	/**
	 * A value object with context variables.
	 * This property is public, because originally it was dynamically declared.
	 *
	 * @var WPSEO_Schema_Context
	 */
	public $context;

	/**
	 * WPSEO_Schema_FAQ_Questions constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array                 $data    Our schema graph.
	 * @param WP_Block_Parser_Block $block   The FAQ block of this type.
	 * @param WPSEO_Schema_Context  $context A value object with context variables.
	 */
	public function __construct( $data, $block, $context ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
		$this->context = $context;
	}

	/**
	 * Find an image based on its URL and generate a Schema object for it.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return array The Schema with Questions added.
	 */
	public function generate() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return [];
	}

	/**
	 * Generate a Question piece.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param array $question The question to generate schema for.
	 *
	 * @return array Schema.org Question piece.
	 */
	protected function generate_question_block( $question ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return [];
	}
}
class-handle-404.php000066600000001376151140126750010135 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend
 */

/**
 * Class WPSEO_Handle_404
 *
 * Handles intercepting requests.
 *
 * @deprecated 14.0
 *
 * @since 9.4
 */
class WPSEO_Handle_404 implements WPSEO_WordPress_Integration {

	/**
	 * Registers all hooks to WordPress.
	 *
	 * @codeCoverageIgnore
	 * @deprecated 14.0
	 *
	 * @return void
	 */
	public function register_hooks() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}

	/**
	 * Handle the 404 status code.
	 *
	 * @codeCoverageIgnore
	 * @deprecated 14.0
	 *
	 * @param bool $handled Whether we've handled the request.
	 *
	 * @return bool True if it's 404.
	 */
	public function handle_404( $handled ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return $handled;
	}
}
class-opengraph-image.php000066600000001365151140126750011436 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend
 */

use Yoast\WP\SEO\Values\Open_Graph\Images;

_deprecated_file( basename( __FILE__ ), 'WPSEO 14.0' );

/**
 * Class WPSEO_OpenGraph_Image.
 *
 * @deprecated 14.0
 */
class WPSEO_OpenGraph_Image extends Images {

	/**
	 * The image ID used when the image is external.
	 *
	 * @var string
	 */
	const EXTERNAL_IMAGE_ID = '-1';

	/**
	 * Constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param string|null          $image     Optional. The Image to use.
	 * @param WPSEO_OpenGraph|null $opengraph Optional. The OpenGraph object.
	 */
	public function __construct( $image = null, WPSEO_OpenGraph $opengraph = null ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );
	}
}
class-primary-category.php000066600000002043151140126750011663 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend
 */

/**
 * Adds customizations to the front end for the primary category.
 *
 * @deprecated 14.0
 */
class WPSEO_Frontend_Primary_Category implements WPSEO_WordPress_Integration {

	/**
	 * Registers the hooks necessary for correct primary category behaviour.
	 */
	public function register_hooks() {
		add_filter( 'post_link_category', [ $this, 'post_link_category' ], 10, 3 );
	}

	/**
	 * Filters post_link_category to change the category to the chosen category by the user.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param stdClass     $category   The category that is now used for the post link.
	 * @param array|null   $categories This parameter is not used.
	 * @param WP_Post|null $post       The post in question.
	 *
	 * @return array|object|WP_Error|null The category we want to use for the post link.
	 */
	public function post_link_category( $category, $categories = null, $post = null ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return $category;
	}
}
frontend.php000066600000016716151140126750007115 0ustar00<?php
/**
 * Backwards compatibility class for WPSEO_Frontend.
 *
 * @package Yoast\YoastSEO\Backwards_Compatibility
 */

use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
use Yoast\WP\SEO\Presenters\Canonical_Presenter;
use Yoast\WP\SEO\Presenters\Meta_Description_Presenter;
use Yoast\WP\SEO\Presenters\Rel_Next_Presenter;
use Yoast\WP\SEO\Presenters\Rel_Prev_Presenter;
use Yoast\WP\SEO\Presenters\Robots_Presenter;
use Yoast\WP\SEO\Surfaces\Helpers_Surface;

/**
 * Class WPSEO_Frontend
 *
 * @codeCoverageIgnore Because of deprecation.
 */
class WPSEO_Frontend {

	/**
	 * Instance of this class.
	 *
	 * @var WPSEO_Frontend
	 */
	public static $instance;

	/**
	 * The memoizer for the meta tags context.
	 *
	 * @var Meta_Tags_Context_Memoizer
	 */
	private $context_memoizer;

	/**
	 * The WPSEO Replace Vars object.
	 *
	 * @var WPSEO_Replace_Vars
	 */
	private $replace_vars;

	/**
	 * The helpers surface.
	 *
	 * @var Helpers_Surface
	 */
	private $helpers;

	/**
	 * WPSEO_Frontend constructor.
	 */
	public function __construct() {
		$this->context_memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );
		$this->replace_vars     = YoastSEO()->classes->get( WPSEO_Replace_Vars::class );
		$this->helpers          = YoastSEO()->classes->get( Helpers_Surface::class );
	}

	/**
	 * Catches call to methods that don't exist and might deprecated.
	 *
	 * @param string $method    The called method.
	 * @param array  $arguments The given arguments.
	 *
	 * @return mixed
	 */
	public function __call( $method, $arguments ) {
		_deprecated_function( $method, 'WPSEO 14.0' );

		$title_methods = [
			'title',
			'fix_woo_title',
			'get_content_title',
			'get_seo_title',
			'get_taxonomy_title',
			'get_author_title',
			'get_title_from_options',
			'get_default_title',
			'force_wp_title',
		];
		if ( in_array( $method, $title_methods, true ) ) {
			return $this->get_title();
		}

		return null;
	}

	/**
	 * Retrieves an instance of the class.
	 *
	 * @return static The instance.
	 */
	public static function get_instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	/**
	 * Outputs the canonical value.
	 *
	 * @param bool $echo        Whether or not to output the canonical element.
	 * @param bool $un_paged    Whether or not to return the canonical with or without pagination added to the URL.
	 * @param bool $no_override Whether or not to return a manually overridden canonical.
	 *
	 * @return string|void
	 */
	public function canonical( $echo = true, $un_paged = false, $no_override = false ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		$presentation = $this->get_current_page_presentation();
		$presenter    = new Canonical_Presenter();
		/** This filter is documented in src/integrations/front-end-integration.php */
		$presenter->presentation = $presentation;
		$presenter->helpers      = $this->helpers;
		$presenter->replace_vars = $this->replace_vars;

		if ( ! $echo ) {
			return $presenter->get();
		}

		echo $presenter->present();
	}

	/**
	 * Retrieves the meta robots value.
	 *
	 * @return string
	 */
	public function get_robots() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		$presentation = $this->get_current_page_presentation();
		return $presentation->robots;
	}

	/**
	 * Outputs the meta robots value.
	 */
	public function robots() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		$presentation            = $this->get_current_page_presentation();
		$presenter               = new Robots_Presenter();
		$presenter->presentation = $presentation;
		$presenter->helpers      = $this->helpers;
		$presenter->replace_vars = $this->replace_vars;
		echo $presenter->present();
	}

	/**
	 * Determine $robots values for a single post.
	 *
	 * @param array $robots  Robots data array.
	 * @param int   $post_id The post ID for which to determine the $robots values, defaults to current post.
	 *
	 * @return array
	 */
	public function robots_for_single_post( $robots, $post_id = 0 ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		$presentation = $this->get_current_page_presentation();

		return $presentation->robots;
	}

	/**
	 * Used for static home and posts pages as well as singular titles.
	 *
	 * @param object|null $object If filled, object to get the title for.
	 *
	 * @return string The content title.
	 */
	private function get_title( $object = null ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		$presentation = $this->get_current_page_presentation();
		$title        = $presentation->title;

		return $this->replace_vars->replace( $title, $presentation->source );
	}

	/**
	 * This function adds paging details to the title.
	 *
	 * @param string $sep         Separator used in the title.
	 * @param string $seplocation Whether the separator should be left or right.
	 * @param string $title       The title to append the paging info to.
	 *
	 * @return string
	 */
	public function add_paging_to_title( $sep, $seplocation, $title ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		return $title;
	}

	/**
	 * Add part to title, while ensuring that the $seplocation variable is respected.
	 *
	 * @param string $sep         Separator used in the title.
	 * @param string $seplocation Whether the separator should be left or right.
	 * @param string $title       The title to append the title_part to.
	 * @param string $title_part  The part to append to the title.
	 *
	 * @return string
	 */
	public function add_to_title( $sep, $seplocation, $title, $title_part ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		if ( $seplocation === 'right' ) {
			return $title . $sep . $title_part;
		}

		return $title_part . $sep . $title;
	}

	/**
	 * Adds 'prev' and 'next' links to archives.
	 *
	 * @link http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html
	 */
	public function adjacent_rel_links() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		$presentation = $this->get_current_page_presentation();

		$rel_prev_presenter               = new Rel_Prev_Presenter();
		$rel_prev_presenter->presentation = $presentation;
		$rel_prev_presenter->helpers      = $this->helpers;
		$rel_prev_presenter->replace_vars = $this->replace_vars;
		echo $rel_prev_presenter->present();

		$rel_next_presenter               = new Rel_Next_Presenter();
		$rel_next_presenter->presentation = $presentation;
		$rel_next_presenter->helpers      = $this->helpers;
		$rel_next_presenter->replace_vars = $this->replace_vars;
		echo $rel_next_presenter->present();
	}

	/**
	 * Outputs the meta description element or returns the description text.
	 *
	 * @param bool $echo Echo or return output flag.
	 *
	 * @return string
	 */
	public function metadesc( $echo = true ) {
		_deprecated_function( __METHOD__, 'WPSEO 14.0' );

		$presentation            = $this->get_current_page_presentation();
		$presenter               = new Meta_Description_Presenter();
		$presenter->presentation = $presentation;
		$presenter->helpers      = $this->helpers;
		$presenter->replace_vars = $this->replace_vars;

		if ( ! $echo ) {
			return $presenter->get();
		}
		$presenter->present();
	}

	/**
	 * Returns the current page presentation.
	 *
	 * @return Indexable_Presentation The current page presentation.
	 */
	private function get_current_page_presentation() {
		$context = $this->context_memoizer->for_current_page();
		/** This filter is documented in src/integrations/front-end-integration.php */
		return apply_filters( 'wpseo_frontend_presentation', $context->presentation, $context );
	}
}
abstract-class-deprecated-schema-piece.php000066600000004363151140126750014616 0ustar00<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Frontend\Schema
 */

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Generators\Schema\Abstract_Schema_Piece;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
use Yoast\WP\SEO\Surfaces\Helpers_Surface;

/**
 * Returns schema Article data.
 *
 * @deprecated 14.0
 *
 * @since 10.2
 */
abstract class WPSEO_Deprecated_Graph_Piece implements WPSEO_Graph_Piece {

	/**
	 * The meta tags context.
	 *
	 * @var Meta_Tags_Context
	 */
	private $context;

	/**
	 * The helpers surface.
	 *
	 * @var Helpers_Surface
	 */
	public $helpers;

	/**
	 * The date helper.
	 *
	 * @var WPSEO_Date_Helper
	 */
	protected $date;

	/**
	 * The new stable piece.
	 *
	 * @var Abstract_Schema_Piece
	 */
	protected $stable;

	/**
	 * The stable class name.
	 *
	 * @var string
	 */
	protected $stable_class_name;

	/**
	 * WPSEO_Schema_Article constructor.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @param string $class_name The class name.
	 */
	public function __construct( $class_name ) {
		$this->stable_class_name = $class_name;
		$this->stable            = new $class_name();

		_deprecated_function( __METHOD__, 'WPSEO 14.0', $this->stable_class_name );

		$memoizer = YoastSEO()->classes->get( Meta_Tags_Context_Memoizer::class );

		// We cannot extend the stable graph piece because a property was made public on it that was previously private.
		// So instead, we instantiate a stable graph piece and delegate to it.
		$this->context         = $memoizer->for_current_page();
		$this->stable->context = $this->context;
		$this->helpers         = YoastSEO()->helpers;
		$this->stable->helpers = $this->helpers;
	}

	/**
	 * Determines whether or not a piece should be added to the graph.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return bool
	 */
	public function is_needed() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', $this->stable_class_name . '::is_needed' );

		return $this->stable->is_needed();
	}

	/**
	 * Returns Article data.
	 *
	 * @deprecated 14.0
	 * @codeCoverageIgnore
	 *
	 * @return array Article data.
	 */
	public function generate() {
		_deprecated_function( __METHOD__, 'WPSEO 14.0', $this->stable_class_name . '::generate' );

		return $this->stable->generate();
	}
}